CentOS 7 python、yumの再インストール

1836 ワード

1、 Python # rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ## # whereis python |xargs rm -frv -rf ## ##xargs, # whereis python ## , 2、 yum # rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps # whereis yum |xargs rm -frv -rf
3、からhttp://mirrors.163.com/centos/7/os/x86_64/Packages/相応のかばんを下ろす
python-2.7.5-68.el7.x86_64.rpm
python-devel-2.7.5-68.el7.x86_64.rpm
python-iniparse-0.4-9.el7.noarch.rpm
python-libs-2.7.5-68.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-8.el7.noarch.rpm
rpm-python-4.11.3-32.el7.x86_64.rpm
yum-3.4.3-158.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-aliases-1.1.31-45.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
yum-plugin-protectbase-1.1.31-45.el7.noarch.rpm
yum-utils-1.1.31-45.el7.noarch.rpm , !
4、ファイル名の変更:
# mv python-setuptools-0.9.8-7.el7.noarch.rpm python-setuptools-0.9.8-7.el7.noarch
# mv yum-utils-1.1.31-45.el7.noarch.rpm yum-utils-1.1.31-45.el7.noarch
# mv yum-plugin-aliases-1.1.31-45.el7.noarch.rpm yum-plugin-aliases-1.1.31-45.el7.noarch
5、取り付けを行う
# rpm -Uvh --replacepkgs python*.rpm
# rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm
 
# python Python 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2 Type "help", "copyright", "credits"or "license"for more information. >>> import yum >>>
 
  , ,