vim /etc/yum.repos.d/upgrade.repo
[upgrade]
name=upgrade
baseurl=http://dev.centos.org/centos/6/upg/x86_64/
enable=1
gpgcheck=0
二:安装软件工具
yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant
三:升级前检查潜在问题
preupg
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. Linux学习,http:// linux.it.net.cn
Do you want to continue? y/n
y
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. Linux学习,http:// linux.it.net.cn
Do you want to continue? y/n
y
preupg --riskcheck --verbose
四:下载安装包
redhat-upgrade-tool --force --cleanup-post --network 7.0 --instrepo=http://mirror.centos.org/centos/7.0.1406/os/x86_64
请自行查看,如果7.0.1406下面没有文件,使用更高的版本
redhat-upgrade-tool --force --cleanup-post --network 7.0 --instrepo=
http://mirror.centos.org/centos/7.2.1511/os/x86_64
如果失败可能是网络问题,
失败后再次执行该语句即可
由于此过程时间比较长,中间很可能因网络原因而中断,再次执行命令会接着上次出错的继续
五:重启机器更新
reboot
重启之后,机器会使用下载好的包开始更新自己,依据这机器的处理速度不同相应的解析时间会有所不同!
升级完成,而且文件系统的类型仍然是升级前的ext4
六:查看版本
lsb_release -a
uname -r
cat /etc/redhat-release