CentOS Linux系统,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。
下载地址: https://mirrors.aliyun.com/centos/
CentOS 过期源(centos-vault):https://developer.aliyun.com/mirror/centos-vault
CentOS arm源(centos-altarch):https://developer.aliyun.com/mirror/centos-altarch/
CentOS Stream源(centos-stream):https://developer.aliyun.com/mirror/centos-stream
CentOS debuginfo源(centos-debuginfo):https://developer.aliyun.com/mirror/centos-debuginfo/
通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。
以CentOS配置阿里云镜像源为例,操作如下:
备份原始文件:
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载阿里云镜像源配置文件:
# Centos8下载,centos8官方源已下线,建议切换centos-vault源sudo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo# 或者sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
# Centos7下载sudo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo# 或者sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# Centos6下载,centos6官方源已下线,建议切换centos-vault源sudo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo# 或者sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
清理缓存并生成新缓存:
sudo yum clean allsudo yum makecache
其他
非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置:
# 删除配置文件中如下两行sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
官方主页: http://www.centos.org/
邮件列表: https://wiki.centos.org/GettingHelp/ListInfo
论坛: https://forums.centos.org/
文档: http://www.centos.org/docs/
Wiki: http://wiki.centos.org/
EPEL(Extra Packages for Enterprise Linux), 是由Fedora Special Interest Group维护的Enterprise Linux(RHEL、CentOS)中经常用到的包。
下载地址:https://mirrors.aliyun.com/epel/
epel过期源(epel-archive):https://developer.aliyun.com/mirror/epel-archive
备份(如有配置其他epel源)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backupmv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
下载新repo 到/etc/yum.repos.d/
epel(RHEL 8/CentOS8)1)安装 epel 配置包
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
2)将 repo 配置中的地址替换为阿里云镜像站地址
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
epel(RHEL 8/CentOS8)
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
epel(RHEL 8/CentOS8) (epel6官方源已下线,建议切换epel-archive源)
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-archive-6.repo
官方主页:https://fedoraproject.org/wiki/EPEL
centos | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
CentOS - USTC Mirror Help
CentOS (tencent.com)