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
相关推荐
showmethetime4 小时前
centos 中查看 内存及磁盘使用率
linux·运维·centos
suger-J4 小时前
01-centos离线升级至almalinux
linux·centos
wowocpp5 小时前
centos 7 安装 java 运行环境
java·linux·centos
xx155802862xx6 小时前
在CentOS 7上仅安装部署MySQL 8.0客户端
mysql·adb·centos
深井冰水8 小时前
mac M2下虚拟机CentOS 8 安装上安装 Berkeley DB
数据库·macos·centos
Penguido8 小时前
基于 Nexus 在 Dockerfile 配置 yum, conda, pip 仓库的方法和参考
linux·docker·centos·conda·pip
Fireworkitte9 小时前
企业级常用的 CentOS版本
linux·运维·centos
爆农18 小时前
centos搭建dokcer和vulhub
linux·运维·centos
Jtti1 天前
CentOS服务器中如何解决内存泄漏问题?
linux·服务器·centos
跪下,大胆刁民1 天前
CentOS 7 基础环境安装脚本
docker·centos·bash