CentOS 8.2 更新源

1. 备份原有源配置

shell 复制代码
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/

2. 设置阿里云镜像源

shell 复制代码
cat > /etc/yum.repos.d/CentOS-Base.repo << 'EOF'
# CentOS-Base.repo
#
# 阿里云镜像源
#

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official

[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official

[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/extras/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official

[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-$releasever - PowerTools
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official

[AppStream]
name=CentOS-$releasever - AppStream
baseurl=https://mirrors.aliyun.com/centos-vault/8.2.2004/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official
EOF

3. 清除缓存并更新

bash 复制代码
yum clean all
yum makecache
yum update -y
相关推荐
(:满天星:)4 小时前
第31篇:块设备与字符设备管理深度解析(基于OpenEuler 24.03)
linux·运维·服务器·网络·centos
ldj202010 小时前
2025 Centos 安装PostgreSQL
linux·postgresql·centos
大锦终15 小时前
【Linux】常用基本指令
linux·运维·服务器·centos
一位摩羯座DBA1 天前
Redhat&Centos挂载镜像
linux·运维·centos
学习3人组1 天前
CentOS配置网络
linux·网络·centos
即将头秃的程序媛1 天前
centos 7.9安装tomcat,并实现开机自启
linux·运维·centos
chanalbert2 天前
CentOS系统新手指导手册
linux·运维·centos
小张不嚣张꒰ঌ(˚ᆺ˚)໒꒱3 天前
Centos7在yum当中遇到Could not resolve host: mirrorlist.centos.org解决方案
linux·运维·服务器·centos
Sally璐璐3 天前
CentOS企业级文件服务器终极部署指南
linux·服务器·centos
岁月玲珑3 天前
【如何判断Linux系统是Ubuntu还是CentOS】
linux·ubuntu·centos