官方升級教程: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/