帮助中心

帮助中心 » 其他相关 » centos6/7/8把yum源更换为阿里源

页码: 1

centos6/7/8把yum源更换为阿里源

- help 2024-07-12 01:04

把centos系统更换阿里云yum源

1. 首先移动剪切备份下旧的yun源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. 下载新的CentOS-Base.repo到/etc/yum.repos.d 根据您系统的版本选择下载

Centos6:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Centos7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Centos8:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3. 更新缓存

yum clean all && yum makecache

yum update -y

完成!

页码: 1