contos7 yum程序运行时报ImportError: No module named sqlitecachec
在163镜像下载如下包 http://mirrors.163.com/centos/7/os/x86_64/Packages/
1:yum-metadata-parser-1.1.4-10.el7
2:yum-plugin-fastestmirror-1.1.31-5
3:yum-3.4.3-161.el7.centos
4:yum-utils-1.1.31-50.el7
rpm -ivh yum*.rpm 报几个依赖要装,分别将所有依赖下载
yum-utils-1.1.31-50.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
yum-3.4.3-161.el7.centos.noarch.rpm
python-urlgrabber-3.10-9.el7.noarch.rpm
rpm-4.11.3-35.el7.x86_64.rpm
xz-libs-5.2.2-1.el7.x86_64.rpm
xz-devel-5.2.2-1.el7.x86_64.rpm
libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm
libxml2-2.9.1-6.el7_2.3.x86_64.rpm
python-chardet-2.2.1-1.el7_1.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
python-kitchen-1.1.1-5.el7.noarch.rpm
再依次安装rpm -ivh xz.rpm 提示文件冲突 file XXX rpm conflicts with file from package XXX
加强制替换参数 rpm -ivh --replacefiles xz.rpm
再依次安装
rpm -ivh --replacefiles lib.rpm
rpm -ivh --replacefiles python.rpm
rpm -ivh --replacefiles rpm-4.11.3.35.e17.centos.noarch.rpm
rpm -ivh --replacefiles yum*.rpm
运行yum list 报错
No module nameed yum
将 vim /usr/bin/yum 中的 #!/usr/bin/python 改为 #!/usr/bin/python2.7
再次运行yum install XX 报错ImportError:No module nameed urlgrabber.grabber
只要把/usr/libexec/urlgrabber-ext-down 这个文件也按上面一样改为python2.7
正常安装软件
网友评论