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
相关推荐
AOwhisky5 小时前
Linux(CentOS)系统管理入门笔记(第十四期)——计划任务与进程调度管理:atcron 与 nicechrt
linux·运维·笔记·centos·云计算·进程调度·计划任务
酷可达拉斯20 小时前
Linux操作系统-shell编程之Grep与正则表达式
linux·运维·服务器·正则表达式·centos
AOwhisky1 天前
Linux(CentOS)系统管理入门笔记(第十二期)——系统管理工具与软件包管理(上篇):Cockpit 与 RPM 包管理
linux·运维·笔记·centos·云计算
qetfw1 天前
CentOS 7 搭建 Sendmail + Dovecot 邮件服务器:SMTP、POP3、IMAP 与 TLS
linux·centos
Dovis(誓平步青云)1 天前
《如何在CentOS 7中添加Plex官方软件源:解决文件磁盘难管理难题》
linux·运维·服务器·后端·生成对抗网络·centos
AAA@峥2 天前
CentOS7 源码编译安装 MySQL5.7|SQL 基础操作 + 备份恢复完整实战
运维·数据库·sql·centos
BullSmall2 天前
CentOS7 阿里云 PG 镜像 PG10.9 → PG17 完整升级指南
阿里云·postgresql·centos
xuefeiniao3 天前
CentOS + 宝塔服务器偶发 SSH、面板、网站全部无法访问排查记录(PHP-FPM 内存耗尽案例)
服务器·centos·ssh·php
是潮汕的灿灿展吖4 天前
Centos离线部署nfs操作
linux·运维·centos
AAA@峥4 天前
CentOS7 搭建 ELK 企业级日志集群:从部署到日志可视化完整实战
运维·elk·centos