- centos7
修改
1.备份
cd /etc/yum.repos.d/
sudo cp CentOS-Base.repo CentOS-Base.repo.bak
2.下载
wget http://mirrors.aliyun.com/repo/Centos-7.repo
3.替换
mv Centos-7.repo CentOs-Base.repo
4.更新
yum clean all
yum makecache
yum update
- centos8
阿里yum地址
http://mirrors.aliyun.com/centos/
修改
1.备份
cd /etc/yum.repos.d/
sudo cp CentOS-AppStream.repo CentOS-AppStream.repo.bak
sudo cp CentOS-Base.repo CentOS-Base.repo.bak
sudo cp CentOS-Extras.repo CentOS-Extras.repo.bak
2.修改三个文件
vim CentOS-AppStream.repo
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
vim CentOS-Base.repo
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
vim CentOS-Extras.repo
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
3.更新
yum update
- 安装epel源
yum install epel-release -y
yum clean all
yum makecache