centos-vault镜像

简介

其中CentOS-Vault.repo对应的是发行该镜像时的yum源版本,使用该镜像源可以下载发行镜像时的yum源。

下载地址:https://mirrors.aliyun.com/centos-vault/

配置方法

建议先备份 /etc/yum.repos.d/ 内的文件。

需要确定您所需要的小版本,如无特殊需要则使用该大版本的最后一个小版本,比如 6.10,5.11,我们将其标记为 $minorver,需要您在之后的命令中替换。

然后编辑 /etc/yum.repos.d/ 中的相应文件,在 mirrorlist= 开头行前面加 # 注释掉;并将 baseurl= 开头行取消注释(如果被注释的话)。 对于 CentOS 8 之前的版本,请把该行内的域名及路径(例如mirror.centos.org/centos/$releasever)替换为 mirrors.aliyun.com/centos-vault/$minorver。 对于 CentOS 8 ,请注意域名及路径发生了更换,此时需要替换的字段为 http://mirror.centos.org/$contentdir/$releasever

以上步骤可以被下方的命令完成

#  Centos 6
minorver=6.10
sudo sed -e "s|^mirrorlist=|#mirrorlist=|g" \
         -e "s|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://mirrors.aliyun.com/centos-vault/$minorver|g" \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

# CentOS 8 
minorver=8.5.2111
sudo sed -e "s|^mirrorlist=|#mirrorlist=|g" \
         -e "s|^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever|baseurl=https://mirrors.aliyun.com/centos-vault/$minorver|g" \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

注意其中的 * 通配符,如果只需要替换一些文件中的源,请自行增删。

注意,如果需要启用其中一些 repo,需要将其中的 enabled=0 改为 enabled=1

最后,更新软件包缓存

sudo yum makecache    

注:配置方法参考自tuna镜像

相关链接

官方主页:https://vault.centos.org/

特别声明:本镜像站内容来自第三方网站,阿里云会尽力审核镜像内容安全,但无法保证其完全合规,请您在下载前慎重考虑。具体请查看《阿里云开发者社区用户服务协议》、《阿里云镜像站特别条款》等。 如您发现镜像站有任何问题,可以填写镜像站投诉表单举报,我们将按照法律规定尽快进行处理。

推荐关注:
· 手慢无!云服务器免费领取,实时计算净省3258元 · 每周二看直播,学最新阿里开源技术

评论

登录后可评论
头像
游客rffaq33z3beuq
2024-07-06发布于 河南
配置方法里面写的要看一下
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客wusf4dvwtfduo
2024-03-29发布于 河南
CentOS8.5的ISO包好像有问题吧,VM里用这个报错。。。
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
1969194098292706
2023-11-07发布于 北京
CentOS7.6的如何修改yum源?请大神指点!!!
Shape Created with Sketch. Combined Shape Created with Sketch. 1
2025-02-27
发布于 广东
https://blog.csdn.net/YSF2017_3/article/details/144558255?fromshare=blogdetail&sharetype=blogdetail&sharerId=144558255&sharerefer=PC&sharesource=YSF2017_3&sharefrom=from_link
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客bfsueqrrxl6pg
2023-01-17发布于 上海
这个写的太敷衍了,作为一个sop,应该做到拿过来就可以用,至少给出一个正确的repo文件示例才行 [base] name=CentOS-$releasever - Base - aliyun baseurl=https://mirrors.aliyun.com/centos-vault/6.9/os/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os enabled=1 gpgcheck=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
xv26rowe56qii、lhdl4hmtzedts觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch.
头像
4kymg6abgslio
2022-09-08
帮助文档目前是没有办法直接使用,可以用以下命令: sed -i.bak -e "s|^mirrorlist=|#mirrorlist=|g" -e "s|^#baseurl|baseurl=http://mirrors.aliyun.com/centos/\$stream/BaseOS/\$basearch/os/\n&|" /etc/yum.repos.d/CentOS-Stream-BaseOS.repo 剩下的基本一样:CentOS-Stream-AppStream.repo、CentOS-Stream-Extras.repo、CentOS-Stream-Extras-common.repo
xv26rowe56qii觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch.
头像
怎么用啊,我不会
aa7sve6wzl62w觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch.
镜像站 + 订阅

阿里巴巴镜像站技术社区

域名使用规则
  • 公网访问地址:

    https://mirrors.aliyun.com/

  • ECS VPC网络访问地址:

    http://mirrors.cloud.aliyuncs.com/

  • ECS 经典网络访问地址:

    http://mirrors.aliyuncs.com/

对于镜像有任何问题,欢迎给我们提问题!
立即提问
热门体验场景