centos系统中yum更新失败怎么办

解决方法:

更换镜像源即可。

依次执行如下命令:

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
vi CentOS-Base.repo

(推荐教程:centos使用教程)

修改配置如下:

[base]
name=Red Hat Enterprise Linux 7.0 -Base
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[update]
name=Red Hat Enterprise Linux 7.0 -Updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=Red Hat Enterprise Linux 7.0 -Extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

保存即可。

相关视频教程推荐:linux视频教程