centos7.5升级到指定的centos7.X版

因为看了下163源 很多7.X的版都没了 只剩下7.9的版本在、又不想重新安装系统的话,要2个方式可以更新系统。

第一种是yum本地源的方式:

down下所谓指定的7.X版本iso,上传到服务器并挂载。

阿里云CentOS 7.6 1810的下载地址:
https://mirrors.aliyun.com/centos-vault/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso

查看目前版本

cat /etc/redhat-release
挂载
mkdir /mnt/cdrom
cd /root
mount ./CentOS-7-x86_64-DVD-1810.iso /mnt/cdrom
备份好系统的repo
新建一个
/etc/yum.repos.d/CentOS-Media.repo 
[Media] 
name=CentOS Media 
baseurl=file:///mnt/cdrom 
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 
enabled=1 


然后直接运行

yum update就可以了

这样的方式是本地的方式。

还有就是用网上的资源 如sohu的

直接用yum源修改就可以了

[C7.6.1810-base]
name=CentOS-7.6.1810 – Base
baseurl=http://mirrors.sohu.com/centos/7.6.1810/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.6.1810-updates]
name=CentOS-7.6.1810 – Updates
baseurl=http://mirrors.sohu.com/centos/7.6.1810/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.6.1810-extras]
name=CentOS-7.6.1810 – Extras
baseurl=http://mirrors.sohu.com/centos/7.6.1810/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.6.1810-centosplus]
name=CentOS-7.6.1810 – CentOSPlus
baseurl=http://mirrors.sohu.com/centos/7.6.1810/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.6.1810-fasttrack]
name=CentOS-7.6.1810 – Fasttrack
baseurl=http://mirrors.sohu.com/centos/7.6.1810/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

或者直接用阿里云的

[C7.6.1810-base]

name=CentOS-7.6.1810 – Base

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

enabled=1

[C7.6.1810-updates]

name=CentOS-7.6.1810 – Updates

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

enabled=1

[C7.6.1810-extras]

name=CentOS-7.6.1810 – Extras

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

enabled=1

[C7.6.1810-centosplus]

name=CentOS-7.6.1810 – CentOSPlus

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/centosplus/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

enabled=1

[C7.6.1810-fasttrack]

name=CentOS-7.6.1810 – Fasttrack

baseurl=https://mirrors.aliyun.com/centos-vault/7.6.1810/fasttrack/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

enabled=1

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注