环境检查
检查DNF版本
dnf --version
首先 下载源
阿里镜像 https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11venohC
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
清华镜像 https://mirrors.tuna.tsinghua.edu.cn/redhat/rhel/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/redhat/rhel/rhel-9-beta/rhel-9-beta.repo
然后编辑repo
vim /etc/yum.repos.d/CentOS-Base.repo
vim主要命令
%s/enabled = 0/enabled = 1/g
%s/gpgcheck= 0/gpgcheck= 1/g
最后 进行元数据缓存后即可使用
dnf clean all
dnf makecache