安装完centos虚拟机后,yum报错信息如下:
快速解决方法
删除原有yum文件
bash
rm -f /etc/yum.repos.d/CentOS-Base.repo
然后重新下载阿里的:
bash
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清理缓存:
bash
yum clean all
更新yum缓存
bash
yum makecache
更新yum(可选)
bash
yum update