【LINUX】 centos7下重装yum和python

因一些操作把yum和python全删除,重新安装

1、下载依赖

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-libsss_nss_idmap-1.16.5-10.el7.x86_64.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7.5.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/glibc-2.17-317.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-devel-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-libs-2.7.5-89.el7.x86_64.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-rpm-macros-3-34.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/libsss_nss_idmap-1.16.5-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python2-rpm-macros-3-34.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-srpm-macros-3-34.el7.noarch.rpm

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-54.el7_8.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-54.el7_8.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/glibc-2.17-317.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-2.9.1-6.el7.5.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7.5.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-45.el7.x86_64.rpm

依赖套依赖,大家懂的,太恶心了,根据提示去下面地址下载即可http://mirrors.163.com/centos/7/os/x86_64/Packages/

执行:rpm -ivh python*rpm      

执行:rpm -ivh yum-*

【LINUX】 centos7下重装yum和python_第1张图片

报错,恶心的很,别着急,往下看。。。

2、下载并编译python2.7.5,不是重点,省略

rpm -Uvh --replacepkgs python*.rpm

【LINUX】 centos7下重装yum和python_第2张图片

 rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm rpm-*

【LINUX】 centos7下重装yum和python_第3张图片

 

你可能感兴趣的:(linux,python,linux,开发语言)