官方升级教程:http://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool
以下是我的升级步骤:
仅在测试机中运行,请勿用于实际环境,操作前整盘备份!!!
以下只为了在纯minimal环境下做测试,建议全新安装。
1、在“/etc/yum.repos.d/”目录中创建文件upgradetool.repo
# cd /etc/yum.repos.d/ # touch upgradetool.repo
2、把以下内容贴进upgradetool.repo
# vi upgradetool.repo
[upg] name=CentOS-$releasever - Upgrade Tool baseurl=http://dev.centos.org/centos/6/upg/x86_64/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
3、安装升级工具
# yum install redhat-upgrade-tool preupgrade-assistant-contents
# preupg -l
5、执行升级分析
# preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
如果没有提示出错,可以继续下一步。否则请检查!!!要全部PASS才可以。
6、导入centos7源
# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
# centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/
国内比较慢,可以使用以下源
# centos-upgrade-tool-cli --network 7 --instrepo=http://mirrors.163.com/centos/7/os/x86_64/