CentOS-Linux-release-7.4.1708-(Core)-的yum重装

时间:2017-11-25 16:12:13   收藏:0   阅读:1288

作者:廖剑曦 时间:2017年11月17日 妖怪未成精,只怪太年轻。我是一个新手,把yum给删了 解决方法分为三部曲

第一部(缺啥补啥,缺yumx下yum)

下载yum源码包并安装

step1:wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz#获取yum安装包

step2 tar zxvf yum-3.4.3.tar.gz

step3 cd yum-3.4.3

然后运行./yummain.py install yum出现如下报错

问题###./yummain.py Traceback (most recent call last): File “./yummain.py”, line 28, in <module> from yum import Errors File “/root/nagios/yum-3.4.3/yum/init.py”, line 52, in <module> import config File “/root/nagios/yum-3.4.3/yum/config.py”, line 30, in <module> from parser import ConfigPreProcessor, varReplace File “/root/nagios/yum-3.4.3/yum/parser.py”, line 4, in <module> import urlgrabber ImportError: No module named urlgrabber

问题###./yummain.py Traceback (most recent call last): File “./yummain.py”, line 28, in <module> from yum import Errors File “/root/nagios/yum-3.4.3/yum/init.py”, line 55, in <module> import rpmsack File “/root/nagios/yum-3.4.3 /yum/rpmsack.py”, line 38, in <module> import yum.depsolve File “/root/nagios/yum-3.4.3/yum/depsolve.py”, line 30, in <module> from transactioninfo import TransactionMember File “/root/nagios/yum-3.4.3 /yum/transactioninfo.py”, line 32, in <module> from sqlitesack import YumAvailablePackageSqlite File “/root/nagios/yum-3.4.3/yum/sqlitesack.py”, line 26, in <module> import yumRepo File “/root/nagios/yum-3.4.3/yum/yumRepo .py”, line 33, in <module> import sqlitecachec ImportError: No module named sqlitecachec

第二部(毛主席说过:“没有条件,创造条件”)

首先安装python-urlgrabber,python-pycurl,yum-metadata-parser

以下是我找到的rpm安装包连接;

http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

http://mirrors.163.com/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm

http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

新建一个文件夹,获取三个安装包 rmp -ivh * #进行安装

如果连接失效推荐到: http://tel.mirrors.163.com/ 里面去找

备用: http://rpm.pbone.net/

安装成功后 再进入yum-3.4.3·文件夹中 运行./yummain.py install yum

如果出现以下报错 ./yummain.py CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf

解决方法:创建yum.conf touch /etc/yum.conf 接着再运行./yummain.py install yum

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!