详细步骤:
1、查看当前CentOS版本 cat /etc/redhat-release
2、更新源 vim /etc/yum.repos.d/upgrade.repo 并输入以下内容: [upgrade] name=upgrade baseurl=https://buildlogs.centos.org/centos/6/upg/x86_64/ enable=1 gpgcheck=0
3、卸载6.x自带的较新的助手,并安装老版[否则会报错] yum erase openscap -y yum install http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm -y
4、安装助手 yum install redhat-upgrade-tool preupgrade-assistant-contents -y
5、检测版本升级的风险,如果控制台输出了错误信息,则需要查询下解决方案并解决 preupg -s CentOS6_7
6、导入CentOS7的key rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
7、开始升级 centos-upgrade-tool-cli --network 7 --instrepo=http://vault.centos.org/centos/7.2.1511/os/x86_64/
8、更新完后,重启服务器 reboot