解决CentOS 7软件源连接失败问题

Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

这个问题是由于 CentOS 系统无法连接到默认的软件源 mirrorlist.centos.org 导致的。

更换软件源

  1. 备份原有的软件源配置文件:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  1. 下载并使用阿里云的 CentOS 7 软件源配置文件:
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  1. 清除 yum 缓存并重新生成缓存:
yum clean all
yum makecache
  1. 再次尝试更新系统:
yum update

你可能感兴趣的:(常见,Bug,解决库,centos,linux,运维)