目前暂时还能用的 CentOS6 的 yum 源,但是速度不快
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
下载
wget -O /etc/yum.repos.d/CentOS-Base.repo https://files.cnblogs.com/files/yeungchie/CentOS6-Base.repo.sh
wget -O /etc/yum.repos.d/epel.repo https://files.cnblogs.com/files/yeungchie/epel6.repo.sh
更新
yum clean all
yum makecache
另一个可用的站点
http://mirror.nsc.liu.se/centos-store
下载依赖包时如果未成功,还可以在windows下载好(win7 + IDM,http://mirror.nsc.liu.se/上的文件下载很顺利),再复制到linux对应的文件夹(find / *.i686.rpm)下覆盖同名的 yum 临时文件,再次执行 yum 命令时就会自动跳过该文件了。需要注意的是,yum 下载的临时文件按类别分布在 cache 文件夹下 updates, base, os 下,要注意查看下载的URL,按类别(updates, base, os)复制到对应的文件夹。
自己在编译 Git 2.9.5 时使用国内的源也没弄好,后来使用 mirror.nsc.liu.se 的 yum 源,配合国内的 epel 源,还通过另一windows机器下载部分文件,才好不容易弄好。
附:文件内容
CentOS6-Base.repo.sh
CentOS-Base.repo
The mirror system uses the connecting IP address of the client and the
update status of each mirror to pick mirrors that are updated to and
geographically close to the client. You should use this for CentOS updates
unless you are manually picking other mirrors.
If the mirrorlist= does not work for you, as a fall back you can try the
remarked out baseurl= line instead.
[base]
name=CentOS- r e l e a s e v e r − B a s e − m i r r o r s . a l i y u n . c o m f a i l o v e r m e t h o d = p r i o r i t y b a s e u r l = h t t p : / / m i r r o r s . a l i y u n . c o m / c e n t o s − v a u l t / 6.10 / o s / releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/ releasever−Base−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−vault/6.10/os/basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/os/ b a s e a r c h / h t t p : / / m i r r o r s . c l o u d . t e n c e n t . c o m / c e n t o s / basearch/ http://mirrors.cloud.tencent.com/centos/ basearch/http://mirrors.cloud.tencent.com/centos/releasever/os/ b a s e a r c h / h t t p : / / m i r r o r s . t e n c e n t y u n . c o m / c e n t o s / basearch/ http://mirrors.tencentyun.com/centos/ basearch/http://mirrors.tencentyun.com/centos/releasever/os/KaTeX parse error: Expected 'EOF', got '#' at position 11: basearch/ #̲mirrorlist=http…releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS- r e l e a s e v e r − U p d a t e s − m i r r o r s . a l i y u n . c o m f a i l o v e r m e t h o d = p r i o r i t y b a s e u r l = h t t p : / / m i r r o r s . a l i y u n . c o m / c e