CentOS6升级CentOS7

Posted John08

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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=0

epel6.repo:
[epel-x86_64]
name=epel-x86_64
baseurl=http://192.168.200.1/reposyum/epel/6/x86_64/
enabled=1
gpgcheck=0

upgrade.repo:
[upgrade]
name=upgrade
baseurl=http://192.168.200.1/reposyum/CentOS6upg/
enable=1
gpgcheck=0
  1. 将镜像iso挂载到本地
mkdir /centos7

vi /etc/fstab

#add
/root/CentOS-7-x86_64-DVD-1511.iso /centos7     iso9660 defaults,loop   0 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目录下

建立软链接:

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=0

epel7.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

以上是关于CentOS6升级CentOS7的主要内容,如果未能解决你的问题,请参考以下文章

CentOS6升级CentOS7

centos7安装or升级CMake3.6

CentOS6升级CentOS7后无法登录修复记录

centos7.6内核升级

2022-01-07-centos7.6升级ssl和ssh

阿里云centos6.6怎么更新yum软件源升级php7