首先: kill -9 1774
Could not resolve host: mirrors.aliyun.com; 未知的错误
出现这个错误的原因是因为没有解析dns
所以需要自己新增DNS
打开文件,编辑文件
vi /etc/sysconfig/network-scripts/ifcfg-enxxxxx
新增如下DNS
DNS1=8.8.8.8
重新启动network
service network restart
更新yum
yum update -y
如果服务提示与NetworkManager冲突,那么需要将其关闭,关闭命令为service NetworkManager stop ,关闭后需要再次重启服务service network restart ,更新yumyum update -y
——
报错二、Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#7 - "Failed to connect to 2a05:d012:8b5:6503:9efb:5cad:348f:e826: 网络不可达"
最终解决方法
这里有太多*.repo了,把这个文件夹删了重装(最后没办法了才这样,误打误撞居然解决了)
rm -rf /etc/yum.repos.d
mkdir /etc/yum.repos.d
找到阿里云镜像,下载repo
wget http://mirrors.aliyun.com/repo/Centos-7.repo
cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
清理yum缓存,重新安装
yum clean all
yum makecache
yum update
泪目,终于通了。