- 进入到yum源相应的目录
cd /etc/yum.repos.d/
- 备份
sudo mkdir bak
sudo mv ./* bak
-
创建
CentOS-Base.repo
sudo vim CentOS-Base.repo
添加:
# file: /etc/yum.repos.d/CentOS-AppStream.repo [aliyun-AppStream] name=CentOS-$releasever - AppStream baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial # file: /etc/yum.repos.d/CentOS-Base.repo [aliyun-BaseOS] name=CentOS-$releasever - Base baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [aliyun-extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.aliyun.com/centos/8.0.1905/extras/x86_64/os/ enabled=1 gpgcheck=1
-
安装epel-release源
dnf -y install epel-release
- 清yum缓存,重新加载
dnf clear all
dnf makecache
dnf repolist