Centos6.5 install yum

2015-11-17 15:03:55   作者:MangoCool   来源:MangoCool

通过rpm方式安装yum过程很纠结,总是出现安装的应用依赖自己的情况,例如:

[root@localhost /]# rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm
error: Failed dependencies:
        /usr/bin/python is needed by yum-3.2.29-69.el6.centos.noarch
        python >= 2.4 is needed by yum-3.2.29-69.el6.centos.noarch
        python(abi) = 2.6 is needed by yum-3.2.29-69.el6.centos.noarch
        python-sqlite is needed by yum-3.2.29-69.el6.centos.noarch

查找好多资料,同时安装之类的都安装不成功,这次解决了,所以必须要记录下来。

首先找到资源地址:http://mirror.centos.org/centos-6/6/os/x86_64/Packages/

我需要安装4个包:

yum-3.2.29-69.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
python-iniparse-0.3.1-2.1.el6.noarch.rpm

命令执行:

wget http://mirror.centos.org/centos-6/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget http://mirror.centos.org/centos-6/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirror.centos.org/centos-6/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget http://mirror.centos.org/centos-6/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
关键的一步,一定要加--nodeps,否则依然报错

rpm -ivh --nodeps yum-3.2.29-69.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm python-iniparse-0.3.1-2.1.el6.noarch.rpm

最后检查一下:

[root@localhost /]# rpm -qa|grep yum
yum-3.2.29-69.el6.centos.noarch
yum-plugin-fastestmirror-1.1.30-30.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64

成功解决!如有问题,欢迎指正和交流!


参考来源:http://serverfault.com/questions/522002/recover-centos-missing-yum-and-rpm

标签: Centos yum install

分享:

上一篇常用查看Linux系统信息命令

下一篇centos6.5系统 python2.6 升级到 python2.7

关于我

一个喜欢唱歌,热衷旅行,爱好电子产品的码农。没事,跟三五好友吼上几嗓子,约上几个背着行囊去露营或者宅在家里抱着孩子敲代码。

座右铭:当你的才华还撑不起你的野心的时候,你就应该静下心来学习,永不止步!

            人生之旅历途甚长,所争决不在一年半月,万不可因此着急失望,招精神之萎葸。


Copyright 芒果酷(mangocool.com) All rights reserved. 湘ICP备14019394号

免责声明:本网站部分文章转载其他媒体,意在为公众提供免费服务。如有信息侵犯了您的权益,可与本网站联系,本网站将尽快予以撤除。