三木

三木

我没有热爱这里,我只是出生在这个地方。

CentOS 6 の yum の問題の解決策

相信すでに多くの友達が、CentOS 6 のサーバーに接続して yum を実行した後にエラーが発生することに気付いたでしょう。これは、CentOS 6 が 2020 年 11 月に EOL(End of Life)に入ったためです。ただし、CentOS 公式は CentOS 6 のユーザーを捨てたくないという理由で、最後のバージョンのイメージを保持していますが、このイメージは更新されません。

修復ワンクリック#

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache

手動修復ガイド#

fastestmirror プラグインの無効化#

vi /etc/yum/pluginconf.d/fastestmirror.conf
# 以下の行を変更
enable=0
# または以下のコマンドを実行
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf

yum リポジトリの置き換え#

以前の yum リポジトリをバックアップします:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

次に、新しい yum リポジトリに置き換えるためのいずれかの方法を選択します:

公式 Vault リポジトリ(海外サーバー用)#

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Official.repo

Alibaba Cloud Vault ミラー(国内サーバー用)#

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo

エラーの詳細#

以下は遭遇する可能性のあるいくつかのエラーメッセージです:

[root@c8-20 ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

または

[root@li496-237 ~]# yum -y install unzip zip
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
http://mirrors.linode.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。