CentOS 镜像

简介

CentOS,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。

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

相关仓库:

配置方法

通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。

1. 备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

centos8(centos8官方源已下线,建议切换centos-vault源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

centos6(centos6官方源已下线,建议切换centos-vault源)

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

3. 运行 yum makecache 生成缓存

4. 其他

非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置: eg:

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo


CentOS 8 结束生命周期如何切换源

公网用户:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache

阿里云ecs用户:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.aliyuncs.com/repo/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache


相关链接

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

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

评论

登录后可评论
头像
liuxiaoshui
2025-03-08发布于 山东
base/7/x86_64/filelists_db FAILED http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/d6d94c7d406fe7ad4902a97104b39a0d8299451832a97f31d71653ba982c955b-filelists.sqlite.bz2: [Errno -1] Metadata file does not match checksum 正在尝试其它镜像。 base/7/x86_64/group_gz FAILED http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/a4e2b46586aa556c3b6f814dad5b16db5a669984d66b68e873586cd7c7253301-c7-x86_64-comps.xml.gz: [Errno -1] Metadata file does not match checksum 正在尝试其它镜像。 昨天开始用不了。
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客p56nai6xhitlo
2025-03-08发布于 四川
denied by IP ACL = blacklist
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
饮水机管理员12313
2025-03-07发布于 上海
centos7配置完后 yum install docker-ce-cli Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.cloud.aliyuncs.com * extras: mirrors.cloud.aliyuncs.com * updates: mirrors.cloud.aliyuncs.com No package docker-ce-cli available. Error: Nothing to do 为啥?
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客h2yem7zrtoibc
2025-03-04发布于 新疆
7是不是已经没法用了
游客p56nai6xhitlo、游客h2yem7zrtoibc觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch.
头像
游客ety34gzbozwf2
2025-02-24发布于 河北
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 在第六个时候报错,789也都正常下载了,只有6是错误怎么回事?
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客2cxhxycmafhzi
2025-02-21发布于 北京
sed -i s/$releasever/7/g /etc/yum.repos.d/Centos-7.repo 替换掉releasever字段为 7,然后yum makecache就可以了,反正Redhat Linux 7是这样的。
游客2cxhxycmafhzi觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch.
头像
1979811511360259
2025-02-17发布于 江苏
7的源是不是有问题? yum makecache报错: http://mirrors.aliyun.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
游客s2d3xuvx6jvse、ytf觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch.
头像
游客o37e2yaljjfte
2025-01-14发布于 上海
openEuler更换阿里源有吗
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
游客s6cawfg4beuui
2024-12-16发布于 山东
[root@localhost ~]# wget https://mirrors.aliyun.com/centos/8.4.2105/BaseOS/x86_64/os/Packages/ppp-2.4.7-26.el8_1.x86_64.rpm --2024-12-16 04:28:58-- https://mirrors.aliyun.com/centos/8.4.2105/BaseOS/x86_64/os/Packages/ppp-2.4.7-26.el8_1.x86_64.rpm 正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 失败:未知的名称或服务。 wget: 无法解析主机地址 “mirrors.aliyun.com” 这是怎么回事
游客s6cawfg4beuui觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch.
头像
游客etdd5inylulgq
2024-11-04发布于 北京
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo --2024-11-04 23:16:36-- https://mirrors.aliyun.com/repo/Centos-7.repo Resolving mirrors.aliyun.com (mirrors.aliyun.com)... failed: Name or service not known. wget: unable to resolve host address ‘mirrors.aliyun.com’ 这是什么意思 访问不了源嘛?
1484014960267477、游客etdd5inylulgq觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch. 1
2024-12-03
发布于 广东
我这边也用不了了
Shape Created with Sketch. Combined Shape Created with Sketch.
镜像站 + 订阅

阿里巴巴镜像站技术社区

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

    https://mirrors.aliyun.com/

  • ECS VPC网络访问地址:

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

  • ECS 经典网络访问地址:

    http://mirrors.aliyuncs.com/

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

你好,我是AI助理

可以解答问题、推荐解决方案等