首页 > 其他 > 详细

Redhat6.6替换Centos Yum源

时间:2019-08-31 17:37:49      阅读:56      评论:0      收藏:0      [点我收藏+]

1.删除当前系统自带的yum

[root@reddhat6_155_201 ~]# rpm -qa |grep yum
yum-rhn-plugin-0.9.1-50.el6.noarch
yum-utils-1.1.30-30.el6.noarch
PackageKit-yum-plugin-0.5.8-23.el6.x86_64
yum-3.2.29-60.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
PackageKit-yum-0.5.8-23.el6.x86_64
yum-plugin-security-1.1.30-30.el6.noarch
[root@reddhat6_155_201 ~]# rpm -qa|grep yum|xargs rpm -e --nodeps

2.下载安装Cenots Yum源依赖的软件

[root@reddhat6_155_201 ~]# mkdir package
[root@reddhat6_155_201 ~]# cd package
[root@reddhat6_155_201 package]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
[root@reddhat6_155_201 package]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@reddhat6_155_201 package]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
[root@reddhat6_155_201 package]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@reddhat6_155_201 package]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

#以上rpm下载可能会出现404,可以直接去http://mirrors.163.com/centos/6/os/x86_64/Packages/下查看具体的版本及下载地址

3.安装依赖的RPM包

[root@reddhat6_155_201 package]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 
[root@reddhat6_155_201 package]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 
[root@reddhat6_155_201 package]# rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm   #注意该RPM包安装方式的区别
[root@reddhat6_155_201 package]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

4.下载阿里Yum源并使用

[root@reddhat6_155_201 package]# cd /etc/yum.repos.d/ &&  rm -f *.repo
[root@reddhat6_155_201 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo    http://mirrors.aliyun.com/repo/Centos-6.repo && wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
[root@reddhat6_155_201 yum.repos.d]# sed -i s/$releasever/6/g  CentOS-Base.repo
[root@reddhat6_155_201 yum.repos.d]# sed -i s/$basearch/x86_64/g CentOS-Base.repo
[root@reddhat6_155_201 yum.repos.d]# sed -i ‘s/$basearch/x86_64/g‘ epel-6.repo
[root@reddhat6_155_201 yum.repos.d]# yum clean all && yum makecache fast

 5.去除mail提示

echo "unset MAILCHECK">> /etc/profile   && source /etc/profile && cat /dev/null > /var/spool/mail/root

 

Redhat6.6替换Centos Yum源

原文:https://www.cnblogs.com/panwenbin-logs/p/11439724.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!