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
相关推荐
j***49563 小时前
Linux(CentOS)安装 Nginx
linux·nginx·centos
v***85715 小时前
Ubuntu介绍、与centos的区别、基于VMware安装Ubuntu Server 22.04、配置远程连接、安装jdk+Tomcat
java·ubuntu·centos
q***49451 天前
Ubuntu介绍、与centos的区别、基于VMware安装Ubuntu Server 22.04、配置远程连接、安装jdk+Tomcat
java·ubuntu·centos
tianyuanwo1 天前
多平台容器化RPM构建流水线全指南:Fedora、CentOS与Anolis OS
linux·运维·容器·centos·rpm
邂逅星河浪漫2 天前
【CentOS】虚拟机网卡IP地址修改步骤
linux·运维·centos
sulikey2 天前
Linux基础指令与权限管理深度解析:从入门到精通
linux·运维·服务器·ubuntu·centos·linux命令·linux权限
U***74692 天前
Linux(CentOS)安装 MySQL
linux·mysql·centos
小雪_Snow3 天前
CentOS 7 测试 docker 镜像源
docker·centos
7***q6083 天前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
toooooop83 天前
CentOS 7 系统上安装 **Nginx + MySQL 5.7 + PHP 7.3 + Redis** 的完整步骤
redis·mysql·nginx·centos·php7