修改Centos7的yum源

12/30/2019 centos

# 1. 备份原镜像文件,便于后期恢复

[root@keepmydream ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
1

# 2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/

Centos5地址:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

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
1
2
3
4
5
6
7
8

# 3. 清除缓存

yum clean all
1

# 4. 生成缓存

yum makecache
1

# 5.更新系统

更新系统时间可能会比较久取决于服务器网速

yum -y update
1
Last Updated: 8/25/2021, 2:35:45 PM
我再没见过 像你一般的星空
Seto