yum repo centos6.5 ,6.6 可用 repodata/repomd.xml: [Errno 14] PYCURL ERROR 22
原因
CentOS 6 於2020年11月30日停止維護,而Yum想要連線舊版本的倉庫。所以,我們需要更新陳舊版本的倉庫然後指向vault。
解決方案
為了解決這個問題,我們需要修改/etc/yum.repos.d/CentOS-Base.repo,然後替換掉所有映象源。
1.進入到 /etc/yum.repos.d/目錄
cd /etc/yum.repos.d/
2.備份原檔案
cp CentOS-Base.repo CentOS-Base.repo.old
3.編輯新檔案
vi CentOS-Base.repo
全部換成下面
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=https://mirrorlist.centos.org/centos/$releasever/os/$basearch/
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/$releasever/updates/$basearch/
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/$releasever/extras/$basearch/
baseurl=https://mirrors.aliyun.com/centos-vault/6.10extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/$releasever/centosplus/$basearch/
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
#baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/$releasever/contrib/$basearch/
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
4.清理yum快取
yum clean all
5.升級yum
yum update