从centos8.0开始,不提供国内yum源,最简单的办法如下:(以8.3版本为例)
在插上联网网线的OS下运行wget -O /etc/yum.repos.d/CentOS-Linux-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo 会出现名为CentOS-Linux-Base.repo的文档
cat CentOS-Linux-Base.repo 把里面有关于AppStream的信息复制粘贴到 CentOS-Linux-AppStream.repo这个文件里面.(以下为示例) [AppStream] name=CentOS-$releasever - AppStream - mirrors.aliyun.com #failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ ? ? ? ? http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ ? ? ? ? http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
把CentOS-Linux-AppStream.repo里面的内容注释掉或者删除保存退出
把/etc/yum.repo.d/路径下CentOS-Linux-BaseOS.repo删除掉.
运行以下命令检查一下可不可以使用
yum clean all && yum makecache yum -y install epel-release
|