Linux 配置163yum源epel 源

今天一个小伙伴询问博主,想换个163源(阿里源、亚马逊应该都是一样,博主没有一一验证)怎么换!博主当然兴致勃勃的准备好了指点小伙伴...但是,你没猜错,打脸了。而且最后还是和小伙伴一起配置好的,所以就写下了这篇文章:

这里的环境是linux的Redhat,不过其他的大致也是一样的


 

配置源的思路简介:

配置163源

配置epel源


一:配置163源

删除本身的源:

1 [root@localhost ~]# cd /etc/yum.repos.d
2 [root@localhost yum.repos.d]# ls
3 rhel-source.repo

将rhel-source.repo放到Redhat文件下:

1 [root@localhost yum.repos.d]# mkdir redhat
2 [root@localhost yum.repos.d]# ls
3 redhat  rhel-source.repo
4 [root@localhost yum.repos.d]# mv rhel-source.repo redhat/
5 [root@localhost yum.repos.d]# ls
6 redhat

 

创建163源文件:

1 [root@localhost yum.repos.d]# vim 163.repo

 

 编辑文件内容:

[163repo]
name=linux redhat 163.repo
baseurl=http://mirrors.163.com/centos/6/os/x86_64/(这里选择163的源,这里是Redhat6的源)
gpgcheck=0
enabled=1

配置epel源:

rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

查询结果:

1 [root@localhost yum.repos.d]# ls
2 163.repo  epel.repo  epel-testing.repo  redhat

 

 

 

 

posted @ 2017-12-28 19:56  魁·帝小仙  阅读(3568)  评论(0编辑  收藏  举报