CentOS 6のサポート終了に伴いyumで「YumRepo Error」が出た場合の対処法
2020/11/30にCentOS 6のサポートが終了たことで「yum install」等のyum系コマンドで「YumRepo Error: All mirror URLs are not using ftp, http[s] or file.」が出るようになってしまったらしいです。
OSを最新にするのが最善ですが仕事の都合でどうしてもCentOS 6.10でなければならなかったため無理矢理対応した際の対応策をメモしておきます。
CentOS-Baseで使用しているmirrorlistとbaseurlが使用できなくなったらしいのでそれを書き換え
# CentOS-Base.repoを開く
vim /etc/yum.repos.d/CentOS-Base.repo
開いたファイル内の「mirrorlist」をコメントアウトし、「baseurl」を新しく設定(※不要な部分は省略してます)
[base]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
[updates]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
[extras]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/
[centosplus]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/centosplus/$basearch/
[contrib]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/contrib/$basearch/
おそらくこれで解消されるかと思います。
SCLo等を入れている場合はそちらのmirrorlistも使用できなくなっているっぽい?(※mirrorlistをコメントアウトしてbsaeurlを有効にしたら一応動いた)
参考https://www.reddit.com/r/sysadmin/comments/k63mcw/centos_repositories_down/