yum网络源地址:
163的网络源地址:
centos6.0的网络源地址:
http://mirrors.163.com/centos/6/os/x86_64/
centos7.0的网络源地址:
http://mirrors.163.com/centos/7/os/x86_64/
阿里云的网络源地址:
centos6.0的网络源地址:
http://mirrors.aliyun.com/repo/Centos-6.repo
centos7.0的网络源地址:
http://mirrors.aliyun.com/repo/Centos-7.repo
http://mirrors.aliyun.com/centos/6/os/x86_64/
2.下载新的repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/Centos-6.repo http://mirrors.aliyun.com/repo/Centos-6.repo
注:这一步下载下来的repo文件对于4年前不修改可以用,但对于目前需要更改地址才可以使用。
3.如下整合了本地yum源和服务器地址的yum源以及阿里云的网络源
[root@master yum.repos.d]# pwd
/etc/yum.repos.d
[root@master yum.repos.d]# cat CentOS-Base.repo
#linux系统本身的yum源地址
[base]
enable=0
name=aaa
baseurl=file:///mnt/server
gpgcheck=0
#将服务器10.1.1.10当作yum源地址
[pxe]
name=pxe
baseurl=http://10.1.1.10/kickstart
gpgcheck=0
#使用阿里云的yum源地址
[aliyun]
name=aliyun
baseurl=http://mirrors.aliyun.com/centos/6/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
4.
5.配置完成后使用命令yum -y list 测试yum
整合后的yum源配置完成
原文:https://blog.51cto.com/7794482/2421141