删除与重装
- 删除 python
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
whereis python |xargs rm -frv
whereis python
- 删除 yum
rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
whereis yum |xargs rm -frv
- 从网易镜像站下载以下安装包(留神版本号可能变动)
wget -i yum.txt
yum.txt
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-sign-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-2.7.5-88.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-devel-2.7.5-88.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-libs-2.7.5-88.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-rpm-macros-3-32.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python2-rpm-macros-3-32.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-srpm-macros-3-32.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7.4.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-2.9.1-6.el7.4.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-devel-2.9.1-6.el7.4.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/xz-devel-5.2.2-1.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-43.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-53.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-53.el7.noarch.rpm
https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-53.el7.noarch.rpm
- 装置 rpm 包
rpm -Uvh --replacepkgs *.rpm
切换镜像源
- 备份
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
- 下载
wget https://mirrors.163.com/.help/CentOS7-Base-163.repo
- clean
yum clean all
yum makecache
本文出自 qbit snap