在安装完linux系统后,执行yum,发现报错,不能正常使用。解决方法如下:
1.查看系统中是否有安装yum
rpm -qa | grep yum
如果有返回,说明yum是安装了的,但还是不能正常使用,所以要卸载掉原来的yum
2.卸载yum
rpm -qa | grep yum | xargs rpm -e --nodeps
再次执行rpm -qa | grep yum 发现没有返回,说明yum已卸载干净
3.重新安装yum
# wgethttp://www.showerlee.com/down/python-iniparse-0.3.1-2.1.el6.noarch.rpm
# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
# wgethttp://www.showerlee.com/down/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
# wgethttp://www.showerlee.com/down/yum-3.2.29-30.el6.centos.noarch.rpm
# wgethttp://www.showerlee.com/down/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# wgethttp://www.showerlee.com/down/PackageKit-yum-0.5.8-20.el6.x86_64.rpm
# rpm -ivh PackageKit-yum-0.5.8-20.el6.x86_64.rpm
# wgethttp://www.showerlee.com/down/PackageKit-yum-plugin-0.5.8-20.el6.x86_64.rpm
# rpm -ivh PackageKit-yum-plugin-0.5.8-20.el6.x86_64.rpm
4.下载配置源
# cd /etc/yum.repos.d/
# wgethttp://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
5.验证yum是否正常使用
执行yum命令,出现yum 选项
大功告成.......
rpm 修复:
cd /var/lib
# mv rpm rpm.old
# mkdir rpm
# rpmdb --initdb
# rpmdb --rebuilddb文章来源:https://www.toymoban.com/news/detail-612066.html
完成修复文章来源地址https://www.toymoban.com/news/detail-612066.html
到了这里,关于yum不能使用解决办法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!