Centos6升级7

今天来升级一个centos6.X 到 centos7
先添加源

vim /etc/yum.repos.d/upgrade.repo
[upgrade]  
name=upgrade  
baseurl=http://dev.centos.org/centos/6/upg/x86_64/  
enable=1  
gpgcheck=0 

网上的些文章会直接进行升级,遇到报错如下

Assessment finished (time 05:57s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [oscapxml.c:416]
Unable to open file /root/preupgrade/result.html
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: '/root/preupgrade/result.html'

解决方法,先执行下面命令

yum erase openscap
yum install http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm
yum -y install redhat-upgrade-tool preupgrade-assistant-contents

再进行升级。

yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant 
preupg -l
preupg -s CentOS6_7

这里官方源7最新版本,好像升级不成功,使用官方备份源的旧版本,然后执行升级!

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

接下来就是等着了

发表评论

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

Captcha Code