redhat6.5更换YUM源。20180918更新版

参考文章:https://blog.csdn.net/u011641865/article/details/78518214

它写的有些过时了,有些东西已经发生的改变。

1.检查yum包 rpm -qa |grep yum 

redhat6.5更换YUM源。20180918更新版_第1张图片
2.删除自带包 
《rpm -aq | grep yum | xargs rpm -e –nodeps 》

这条命令不能用

[root@localhost rules.d]# rpm -e yum-utils-1.1.30-14.el6.noarch --nodeps
[root@localhost rules.d]# rpm -e PackageKit-yum-0.5.8-21.el6.x86_64 --nodeps
[root@localhost rules.d]# rpm -e yum-metadata-parser-1.1.2-16.el6.x86_64 --nodeps
[root@localhost rules.d]# rpm -e yum-plugin-security-1.1.30-14.el6.noarch --nodeps
[root@localhost rules.d]# rpm -e yum-rhn-plugin-0.9.1-48.el6.noarch --nodeps
[root@localhost rules.d]# rpm -e yum-3.2.29-40.el6.noarch --nodeps

[root@localhost rules.d]# rpm -e PackageKit-yum-plugin-0.5.8-21.el6.x86_64 --nodeps
只能手动删除
3.再检查一下 
rpm -qa |grep yum 

没有了

4.下载更新包(http://mirrors.163.com/centos/6/os/x86_64/Packages/) 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-updateonboot-1.1.30-41.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-utils-1.1.30-41.el6.noarch.rpm

5.执行安装 

先执行升级操作

rpm -Uvh python-urlgrabber-3.9.1-11.el6.noarch.rpm

再执行安装YUM-包的操作

rpm -ivh yum-*

redhat6.5更换YUM源。20180918更新版_第2张图片

cd /etc/yum.repos.d/ 
 mv rhel-source.repo rhel-source.repo.bak

 

# cd /etc/yum.repos.d/

# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

# vi CentOS6-Base-163.repo

  :%s/$releasever/6/g

然后按enter建

 

清理缓存
yum clean all

yum makecache

验证

yum install telnet

你可能感兴趣的:(计算机知识)