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元 · 每周二看直播,学最新阿里开源技术

评论

登录后可评论
头像
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.
头像
7的源是不是有问题? yum makecache报错: http://mirrors.aliyun.com/centos/7/AppStream/x86_64/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
ytf觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch.
头像
openEuler更换阿里源有吗
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
[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.
头像
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.
头像
#cd /etc/yum.repos.d/ #rm -rf * #curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo # yum clean all 已加载插件:fastestmirror Forbidden</title></head><body><h1>403 Forbidden</h1><p>You don\'t have permission to access the URL on this server.</p><p>denied by IP ACL = blacklist</p><hr/>Powered by Tengine <br/>CDN Request Id: 77a7ac1a17296144502011935e</body></html>' [root@opengauss90 yum.repos.d]#yum makecache 然后也是上面的错误,是怎么回事呢
游客etdd5inylulgq觉得很赞
Shape Created with Sketch. 1 Combined Shape Created with Sketch. 1
2024-10-28
你的防火墙拦截了 这个阿里云的镜像地址 去入站规则创建一个 或者设置一下防火墙的规则
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
https://mirrors.aliyun.com/repo/Centos-7.repo/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found https://wiki.centos.org/yum-errors https://mirrors.aliyun.com/repo/Centos-7.repo/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found 配置yum源为啥提示这个
1979811511360259、游客etdd5inylulgq觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch. 1
2024-10-28
肯定复制错了
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
YangPC
2024-09-12
如果您需要帮助,我可以远程协助您解决问题。 732903.hlcode.cn/?id=NK1f1gt
游客wmgjlwnkkrq24、YangPC觉得很赞
Shape Created with Sketch. 2 Combined Shape Created with Sketch.
头像
大佬们问一下:sudo yum update或sudo yum makecache都会报错下面的内容这是为啥? Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Shape Created with Sketch. Combined Shape Created with Sketch. 2
2024-10-28
你的服务器上面的repo文件有问题,先把其他 的备份好移动到其他目录下,然后按照步骤去touch一个一样的文件名 再去复制下面下载地址
Shape Created with Sketch. Combined Shape Created with Sketch.
2024-10-07
我也是,你怎么解决的
Shape Created with Sketch. Combined Shape Created with Sketch.
头像
今天的源咋这么慢
游客etdd5inylulgq觉得很赞
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/

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