CentOS7.2升级到7.3

前言

最近公司接手一个运维项目,需要将环境搭建起来,但现有的cento系统版本是7.2,而项目的最低要求是7.3,现记录一下升级到指定版本的过程。
在这里插入图片描述

过程

  1. 备份旧的版本仓库文件
[root@server-1 yum.repos.d] mkdir -p /etc/yum.repos.d/backup
[root@server-1 yum.repos.d] mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
  1. 创建要升级到版本的仓库文件
[root@server-1 yum.repos.d] vim /etc/yum.repos.d/CentOS-Base.repo

内容如下

# CentOS Vault contains rpms from older releases in the CentOS-7
# tree.
# C7.3.1611
[C7.3.1611-base]
name=CentOS-7.3.1611 - Base
baseurl=https://vault.centos.org/7.3.1611/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[C7.3.1611-updates]
name=CentOS-7.3.1611 - Updates
baseurl=https://vault.centos.org/centos/7.3.1611/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[C7.3.1611-extras]
name=CentOS-7.3.1611 - Extras
baseurl=https://vault.centos.org/7.3.1611/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[C7.3.1611-centosplus]
name=CentOS-7.3.1611 - CentOSPlus
baseurl=https://vault.centos.org/7.3.1611/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

[C7.3.1611-fasttrack]
name=CentOS-7.3.1611 - Fasttrack
baseurl=https://vault.centos.org/7.3.1611/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
  • 查看现在可用仓库列表
[root@server-1 yum.repos.d] yum repolist
  • 查看现在可用仓库版本
[root@server-1 yum.repos.d] yum list updates | grep "centos-release"
  • 清空本地缓存
[root@server-1 yum.repos.d] yum clean all
[root@server-1 yum.repos.d] rm -rf /var/cache/yum
  • 版本升级
[root@server-1 yum.repos.d] yum -y update
  • 清空本地缓存,更新版本库文件
[root@server-1 yum.repos.d] yum clean all
[root@server-1 yum.repos.d] yum makecache
  • 重启
reboot

后记

  • 其中第4、6、7步会下载很长时间,看网速了。
  • 第2步中,网上有人用的vim /etc/yum.repos.d/CentOS-Vault.repo,我试了不成功,换成CentOS-Base.repo就可以。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值