CentOS6 的 yum 源 2023-3-27

本文介绍了如何备份CentOS6的yum源,并提供了两个可用的CentOS 6 yum源,包括阿里云和NSC LIU SE的镜像站。还分享了一种在Windows下载依赖包后复制到Linux进行yum安装的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目前暂时还能用的 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/ releaseverBasemirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centosvault/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

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值