CentOS 6.5升级至CentOS 7

CentOS 6.5升级至CentOS 7

首先看下当前的系统版本

cat /etc/redhat-release 

配置更新源

vi  /etc/yum.repos.d/upgrade.repo 
[upgrade]
name=upgrade
baseurl=https://buildlogs.centos.org/centos/6/upg/x86_64/
enable=1
gpgcheck=0

安装更新助手

yum install redhat-upgrade-tool preupgrade-assistant-contents -y

由于centos 6.5自带的助手之一版本较高,所以需要卸载了装个更老的:

yum erase openscap -y
yum install redhat-upgrade-tool preupgrade-assistant-contents -y

Centos6.5升级7提示No package redhat-upgrade-tool available

这个时候你可以通过在线安装RMP包解决。

yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-1.0.2-33.0.3.el6.centos.x86_64.rpm -y
 yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-contents-0.5.13-1.0.5.el6.centos.noarch.rpm -y
yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-ui-1.0.2-33.0.3.el6.centos.x86_64.rpm -y
yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm -y

升级前检查潜在问题

preupg -s CentOS6_7

升级检测通过后,在线下载centos7镜像,或者通过sftp本地上传。
先导入RPM签名证书

rpm --import https://mirrors.ustc.edu.cn/epel/RPM-GPG-KEY-EPEL-7

开始更新(在线更新)

 centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64

注意

在线更新很慢,因为是要链接到centos的备份地址官网进行更新,所以有另外个选择:本地更新

进行本地更新

利用下载好的镜像进行本地更新:

wget https://archive.kernel.org/centos-vault/7.2.1511/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso
centos-upgrade-tool-cli --iso=/home/CentOS-7-x86_64-DVD-1511.iso

(如果有问题可以加–force参数,但生产环境不建议)

这两种方式的区别就是,在线的话是先更新好,然后重启。本地的话是先重启,然后重启过程中进行更新。

升级完成后,重启进入新系统。

setup
reboot
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
升级 CentOS6.5 到 CentOS7.0 是一个比较复杂的过程,需要仔细阅读并按照以下步骤进行操作: 1. 备份数据:在进行任何系统升级之前,务必备份所有重要数据,以防止意外数据丢失。 2. 更新 CentOS6.5:在升级之前,先确保 CentOS6.5 的所有软件包都是最新的。执行以下命令更新系统: ``` yum update ``` 3. 安装 CentOS 7.0 的升级工具:为了将 CentOS 6.5 升级CentOS 7.0,需要安装一个名为“redhat-upgrade-tool”的软件包。执行以下命令安装该软件包: ``` yum install redhat-upgrade-tool preupgrade-assistant-contents ``` 4. 运行系统升级工具:安装完升级工具后,使用以下命令启动升级过程: ``` preupg ``` 此命令将生成一个报告,其中列出了可以升级的软件包和问题,如果没有问题,则可以继续进行升级过程。 5. 更新 yum 配置文件:将 CentOS 6.5 的 yum 配置文件备份并替换为 CentOS 7.0 的 yum 配置文件。执行以下命令: ``` cp /etc/yum.conf /etc/yum.conf.bak cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo ``` 6. 运行系统升级命令:最后,运行以下命令将 CentOS 6.5 升级CentOS 7.0: ``` redhat-upgrade-tool-cli --network 7.0 --instrepo=http://mirrors.aliyun.com/centos/7/os/x86_64/ ``` 此命令将下载并安装所有必需的软件包,升级系统到 CentOS 7.0。 7. 重启系统:完成升级后,重启系统以使更改生效: ``` reboot ``` 请注意,此过程可能需要一些时间,并且在执行过程中可能会出现错误或问题。因此,请务必按照上述步骤进行操作,并确保已备份所有数据。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值