标签:
本人在帝都,觉得首都在线(yun-idc.com)的yum源速度不错,故选它了。具体操作方法是将以下文件保存到 /etc/yum.repos.d/yun-idc.repo 即可。
[base] name=CentOS-$releasever - Base baseurl=http://mirrors.yun-idc.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.yun-idc.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.yun-idc.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.yun-idc.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
还可以用脚本的方式去跑
#!/bin/bash cat > /etc/yum.repos.d/yun-idc.repo << EOF [base] name=CentOS-\$releasever - Base baseurl=http://mirrors.yun-idc.com/centos/\$releasever/os/\$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-\$releasever - Updates baseurl=http://mirrors.yun-idc.com/centos/\$releasever/updates/\$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-\$releasever - Extras baseurl=http://mirrors.yun-idc.com/centos/\$releasever/extras/\$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-\$releasever - Plus baseurl=http://mirrors.yun-idc.com/centos/\$releasever/centosplus/\$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 EOF echo [$(date ‘+%Y-%m-%d %H:%M:%S‘)] - done.
除此以外,还有网易的centos yum源
http://mirrors.163.com/.help/centos.html
本文到此结束,谢谢~
标签:
原文地址:http://www.cnblogs.com/highend/p/centos-7_yum_config.html