一、查看当前系统版本
# rpm -q centos-release
或
# cat /etc/redhat-release
二、修改yum源,确定更新仓库版本
CentOS 7的更新源在/etc/yum.repos.d/
目录下,由于我已经将yum源更换为阿里云的yum源,配置文件如下,更换:
name=CentOS-7.5.1804 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.5.1804/os/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.5.1804/os/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.5.1804/os/$basearch/
gpgcheck=1
gpgkey=http://olcentchan.chinacloudapp.cn/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-7.5.1804 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://olcentchan.chinacloudapp.cn/centos/7.5.1804/updates/$basearch/
http://olcentchan.chinacloudapp.cn/centos/7.5.1804