因要升级python版本,为了避免多版本冲突,卸载了python2.7.5,导致yum软件无法使用,报如下错误:
1:坏的解释器
2:no module named _rpm
搜索资料显示自己要重装python2.7.5和yum软件
我的版本是centos7.6
所需软件包如下:
libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
python-2.7.5-76.el7.x86_64.rpm
python-backports-1.0-8.el7.x86_64.rpm
python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
python-chardet-2.2.1-1.el7_1.noarch.rpm
python-devel-2.7.5-76.el7.x86_64.rpm
python-iniparse-0.4-9.el7.noarch.rpm
python-ipaddress-1.0.16-2.el7.noarch.rpm
python-kitchen-1.1.1-5.el7.noarch.rpm
python-libs-2.7.5-76.el7.x86_64.rpm
python-pycurl-7.19.0-19.el7.x86_64.rpm
python-setuptools-0.9.8-7.el7.noarch.rpm
python-urlgrabber-3.10-9.el7.noarch.rpm
python-virtualenv-15.1.0-2.el7.noarch.rpm
rpm-4.11.3-35.el7.x86_64.rpm
rpm-build-4.11.3-35.el7.x86_64.rpm
rpm-build-libs-4.11.3-35.el7.x86_64.rpm
rpm-libs-4.11.3-35.el7.x86_64.rpm
rpm-python-4.11.3-35.el7.x86_64.rpm
rpm-sign-4.11.3-35.el7.x86_64.rpm
yum-3.4.3-161.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-aliases-1.1.31-50.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
yum-plugin-protectbase-1.1.31-50.el7.noarch.rpm
yum-utils-1.1.31-50.el7.noarch.rpm
去官网找对应系统的版本,依次下载到文件夹中,也可以使用rpm -Uvh直接安装,会有很多依赖问题
执行一起安装,如还有依赖问题就去官网下载,然后覆盖安装
rpm -Uvh --replacepkgs *.rpm
安装完没有报错,就安装成功:
依次执行如下命令,建立yum缓存:
yum clean all
yum makecache
yum --skip-broken update