CentOS6升级CentOS7

愿君学长松,慎勿作桃李。这篇文章主要讲述CentOS6升级CentOS7相关的知识,希望能为你提供帮助。

  1. 配置仓库源
centos6.repo: [base] name=base baseurl=http://192.168.200.1/reposyum/CentOS/6.8/os/x86_64/ enabled=1 gpgcheck=0[extras] name=extras baseurl=http://192.168.200.1/reposyum/CentOS/6.8/extras/x86_64/ enabled=1 gpgcheck=0[updates] name=updates baseurl=http://192.168.200.1/reposyum/CentOS/6.8/updates/x86_64/ enabled=1 gpgcheck=0[plus] name=plus baseurl=http://192.168.200.1/reposyum/CentOS/6.8/centosplus/x86_64/ enabaled=1 gpgcheck=0epel6.repo: [epel-x86_64] name=epel-x86_64 baseurl=http://192.168.200.1/reposyum/epel/6/x86_64/ enabled=1 gpgcheck=0upgrade.repo: [upgrade] name=upgrade baseurl=http://192.168.200.1/reposyum/CentOS6upg/ enable=1 gpgcheck=0

  1. 将镜像iso挂载到本地
mkdir /centos7vi /etc/fstab#add /root/CentOS-7-x86_64-DVD-1511.iso /centos7iso9660 defaults,loop0 0

  1. 安装软件工具
yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant
  1. 升级评估
preupg
评估过程会出现找不到result.html的报错,可忽略
  1. 强制升级
redhat-upgrade-tool-cli --device=/centos7 --force
reboot
  1. 升级过程
  2. 验证
uname -r
3.10.0-327.el7.x86_64
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
  1. 将CentOS6的so.0.0.1文件复制到/lib64目录下
建立软链接:
【CentOS6升级CentOS7】cd /lib64
ln -s libpcre.so.0.0.1 libpcre.so.0
  1. 更改源为CentOS7的源
删除所有源,去掉fstab挂载的iso文件,删除/centos7目录
新增yum源:
centos7.repo: [base] name=base baseurl=http://192.168.200.1/reposyum/CentOS/ 7.2.1511/os/x86_64/ enabled=1 gpgcheck=0[extras] name=extras baseurl=http://192.168.200.1/reposyum/CentOS/ 7.2.1511/extras/x86_64/ enabled=1 gpgcheck=0[updates] name=updates baseurl=http://192.168.200.1/reposyum/CentOS/ 7.2.1511/updates/x86_64/ enabled=1 gpgcheck=0[plus] name=plus baseurl=http://192.168.200.1/reposyum/CentOS/ 7.2.1511/centosplus/x86_64/ enabaled=1 gpgcheck=0epel7.repo: [epel-x86_64] name=epel-x86_64 baseurl=http://192.168.200.1/reposyum/epel/7/x86_64/ enabled=1 gpgcheck=0

  1. 更新系统
yum clean all
yum makecache
yum upgrade

    推荐阅读