更改centOS中的源

首先下载你想安装的源,目前国内有很多很好的源,比如阿里云,163等等,还有各大高校的源

这里我们随便下载一个,但是需要下载对应版本

下载CentOS-Base.repo 到/etc/yum.repos.d/

5版本对应

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

6版本对应

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

7版本对应

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

然后执行命令

[root@localhost ~]# rpm -e rpmforge-release --nodeps
 
[root@localhost ~]# yum clean all 
 
[root@localhost ~]# yum update

命令执行成功则安装好了

 

posted on 2018-01-18 12:32  特立独行的十楼  阅读(142)  评论(0)    收藏  举报

导航