Red Hat Linux安装CentOS的yum源_yum-plugin-fastestmirror is needed by yum-(1)

[root@orcl ~]# rpm -ivh python-iniparse-….noarch.rpm
warning: python-iniparse-0.4-9.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
python(abi) = 2.7 is needed by python-iniparse-0.4-9.el7.noarch


 当前安装版本与服务器不兼容,退后一个版本再试。  
 查看当前发行版本号



cat /etc/issue


 



遇到的错误

 ![Red Hat Linux安装CentOS的yum源Red Hat Linux安装CentOS的yum源](http://www.linuxprobe.com/wp-content/uploads/2017/02/centos-linux-yum02-1.jpg "Red Hat Linux安装CentOS的yum源Red Hat Linux安装CentOS的yum源")


 系统位数与安装程序包位数不一致 file /bin/ls



error: Failed dependencies:
libc.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libc.so.6(GLIBC_2.2.5)(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libglib-2.0.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libpthread.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libpython2.6.so.1.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libsqlite3.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libxml2.so.2()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libxml2.so.2(LIBXML2_2.4.30)(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64



重新下载32位程序包


[root@orcl ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
Preparing… ########################################### [100%]
package python-iniparse-0.3.1-2.1.el6.noarch is already installed
[root@orcl ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
Preparing… ########################################### [100%]
1:yum-metadata-parser ########################################### [100%]
[root@orcl ~]# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
Preparing… ########################################### [100%]
1:yum-plugin-fastestmirro########################################### [ 50%]
2:yum ########################################### [100%]
[root@orcl ~]#


 注意最后两个包必需同时安装,否则会相互依赖  
 更改yum源(使用网易的CentOS镜像源)



[root@localhost yum]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@localhost yum.repos.d]# vi CentOS6-Base-163.repo


 将所有 $releasever 修改为具体的版本号,我这里写的是6.8,这个自己打开(http://mirrors.163.com/centos)找一下就可以。



CentOS-Base.repo

The mirror system uses the connecting IP address of the client and the

update status of each mirror to pick mirrors that are updated to and

geographically close to the client. You should use this for CentOS updates

unless you are manually picking other mirrors.

If the mirrorlist= does not work for you, as a fall back you can try the

remarked out baseurl= line instead.

[base]
name=CentOS- r e l e a s e v e r − B a s e − 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 6.8 / o s / releasever - Base - 163.com baseurl=http://mirrors.163.com/centos/6.8/os/ releaseverBase163.combaseurl=http://mirrors.163.com/centos/6.8/os/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS- r e l e a s e v e r − U p d a t e s − 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 6.8 / u p d a t e s / releasever - Updates - 163.com baseurl=http://mirrors.163.com/centos/6.8/updates/ releaseverUpdates163.combaseurl=http://mirrors.163.com/centos/6.8/updates/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS- r e l e a s e v e r − E x t r a s − 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 6.8 / e x t r a s / releasever - Extras - 163.com baseurl=http://mirrors.163.com/centos/6.8/extras/ releaseverExtras163.combaseurl=http://mirrors.163.com/centos/6.8/extras/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS- r e l e a s e v e r − P l u s − 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 6.8 / c e n t o s p l u s / releasever - Plus - 163.com baseurl=http://mirrors.163.com/centos/6.8/centosplus/ releaseverPlus163.combaseurl=http://mirrors.163.com/centos/6.8/centosplus/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS- r e l e a s e v e r − C o n t r i b − 163. c o m b a s e u r l = h t t p : / / m i r r o r s . 163. c o m / c e n t o s / 6.8 / c o n t r i b / releasever - Contrib - 163.com baseurl=http://mirrors.163.com/centos/6.8/contrib/ releaseverContrib163.combaseurl=http://mirrors.163.com/centos/6.8/contrib/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


 清理yum缓存



yum clean all


 显示已安程序包及可安程序包



yum list


 可以按要求更新程序包或安装



yum update / yum install 包名


 到此结束了,亲们。


 




### 最后的话

最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!

### 资料预览

给大家整理的视频资料:

![](https://img-blog.csdnimg.cn/img_convert/1a19b58ffe3b9622fb5498f0a71dac95.png)

给大家整理的电子书资料:

  

![](https://img-blog.csdnimg.cn/img_convert/43a90e8ed1b46eaa4805cd5648d4c04b.png)



**如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!**

**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**


**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
到真正的技术提升。**

**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**


**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
  • 6
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值