为 CentOS 7.6 (7.6.1810) 配置阿里云 Vault 源

第一步:确认你的系统版本

cat /etc/redhat-release 2

第二步:备份并替换 repo 文件

备份原有 repo

mkdir -p /etc/yum.repos.d/backup

mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/ 2>/dev/null || true

创建专用于 CentOS 7.6.1810 的 repo

cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF

base

name=CentOS-7.6 - Base

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/os/\\$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

enabled=1

updates

name=CentOS-7.6 - Updates

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/updates/\\$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

enabled=1

extras

name=CentOS-7.6 - Extras

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/extras/\\$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

enabled=1

centosplus

name=CentOS-7.6 - Plus

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/centosplus/\\$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

enabled=0

EOF

第三步:清理缓存并测试

yum clean all

rm -rf /var/cache/yum

yum makecache

yum list installed | head -5 # 查看是否能读取包列表

yum install -y wget # 测试安装

相关推荐
JAVA面经实录91718 小时前
Linux 常用命令完整知识体系
java·linux·开发语言·汇编
艾莉丝努力练剑1 天前
OpenCode AI 编程:Ubuntu 24.04 环境安装与使用指南
linux·服务器·网络·人工智能·tcp/ip·ubuntu
崇山峻岭之间1 天前
Keil5输出hex转换为bin的设置
linux·运维·服务器
谷雪_6581 天前
Linux 网络命名空间:从内核原理到企业级容器网络架构全景实战
linux·网络·架构
qq_163135751 天前
Linux 【03- chgrp命令超详细教程】
linux
CodeStats1 天前
【编程语言】深度梳理C/C++、Java、Python、Go、Rust的区别
java·linux·c语言·c++·python·rust·go
我会尽全力 乐观而坚强1 天前
MySQL库与表的操作
linux·数据库·mysql
着迷不白1 天前
Linux 磁盘管理完全指南:分区、文件系统、挂载与 LVM 实战
linux·运维·服务器
山川而川-R1 天前
LangChain
linux·运维·服务器
QH_ShareHub1 天前
Linux 根目录结构详解
linux·运维·服务器