1、查看现版本信息
cat /etc/redhat-release
2、创建挂载目录
mkdir /centos
3、上传需要升级的版本的镜像并挂载
mount ./CentOS-7-x86_64-DVD-1810.iso /centos/
4、备份yum源配置
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
5、写入新的yum源配置
cat << EOF > /etc/yum.repos.d/CentOS-Media.repo
[Media]
name=CentOS Media
baseurl=file:///centos
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
EOF
6、进行系统升级
yum clean all
yum makecache
yum update -y
7、查看升级后版本信息
cat /etc/redhat-release