CentOS6.x升级Centos7.x
dev.centos.org is a testing repo. It contains contributed packages that have been built but are still awaiting feedback. Once that package receives enough positive feedback it is moved to one of the main CentOS repos. If not enough feedback is received then it is assumed that no one is interested in the package and it will be removed. So yes, it's really important that users provide feedback on testing packages. 官方已经删除了dev.centos.org这个仓库,已经不能通过这个升级了,都是建议直接重新安装
注1:网上有很多centos6升级到centos7的技术文,但基本会报错,或者升级时采用的源不支持,本文只是做一次整合,绕过错误和不能用于升级的源。
注2:不建议CentOS6.6+系统升级CentOS7,6.6以上的系统很多服务组件比7系统版本更新,可能会造成升级失败
注3:建议使用纯净版系统升级,第三方组件和服务越多,越容易失败
step1:
[root@localhost ~]# cat << EOF >> /etc/yum.repos.d/upgrade.repo
> [upgrade]
> name=upgrade
> baseurl=http://dev.centos.org/centos/6/upg/x86_64/
> enable=1
> gpgcheck=0
> EOF
step2:
[root@localhost ~]# yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm -y
注:必须安装openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm这个包,不然肯定会报错
[root@localhost ~]# yum install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant -y
step3:
[root@localhost ~]# preupg -l
CentOS6_7
[root@localhost ~]# preupg -s CentOS6_7
显示如下截图为验证成功,可以升级
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KwVCnaR8-1606195899385)(http://images.sarehart.com/uodate_7.png)]
step4:
[root@localhost ~]# redhat-upgrade-tool --network 7 --instrepo=http://mirror.nsc.liu.se/centos-store/7.2.1511/os/x86_64/
建议只升级到7.2系统,如想使用最新的7.x系统,可以在升级7.2完成后使用update升级
当出现如下信息时,表示升级成功,重启系统即可
(265/266): zlib-1.2.7-13.el7.x86_64.rpm | 89 kB 00:00
(266/266): zlib-devel-1.2.7-13.el7.x86_64.rpm | 49 kB 00:00
testing upgrade transaction.
rpm transaction 100% [==============================================================================================================]
rpm install 100% [==================================================================================================================]
setting up system for upgrade Finished. Reboot to start upgrade.
注意:如升级的时候显示check字样,表示系统中存在很多第三方组件,可能会造成升级失败,可以使用如下方式升级,但可能会造成系统无法重启,不推荐
[root@localhost ~]# redhat-upgrade-tool --network 7 --instrepo=http://vault.centos.org/7.2.1511/os/x86_64/ --format