vi /etc/yum.repos.d/upgradtool.repo
[upg] name=CentOS-$releasever-UpgradeTool 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
yum -y install redhat-upgrade-tool preupgrade-assistant-contents
rpm --import http://mirrors.neusoft.edu.cn/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
redhat-upgrade-tool --force --network 7 --instrepo=http://mirrors.yun-idc.com/centos/7/os/x86_64/
reboot
原文链接:https://www.f2er.com/centos/381719.html