码迷,mamicode.com
首页 > 其他好文 > 详细

设置国内的centos 7 yum源

时间:2015-09-28 11:19:16      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

本人在帝都,觉得首都在线(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

 

本文到此结束,谢谢~

设置国内的centos 7 yum源

标签:

原文地址:http://www.cnblogs.com/highend/p/centos-7_yum_config.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!