Tlanyan.me /upgrade-cen…
Pay attention to
If the upgrade is not necessary, reinstall the system for the following reasons:
- Not all systems upgrade smoothly from 6 to 7, and the less software you install, the more likely the upgrade is to succeed.
- Only the system 6.5 or later can be upgraded to a system 7.2 or higher.
- Upgrading takes no less time than reinstalling, and in most cases takes longer and more effort;
- Dealing with dependencies after the upgrade is complete is a big problem.
I upgraded two computers on the same day, one successfully and one failed. The successful computer spent an extra day dealing with dependencies and problems, while the failed computer had a good system and necessary software. Therefore, you are advised to back up data and reinstall the system if not necessary.
operation
To upgrade from 6 to 7 by software, perform the following steps:
-
Update the current system to the latest version: yum update-y
-
Install old OpenSCAP: yum remove -y openscap && yum install -y http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm;
-
Add the upgradeTool source:
cat <<EOF >/etc/yum.repos.d/upgradetool.repo [upgrade] 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 EOF Copy the code
-
Yum install -y redhat-upgrade-tool preupgrade-assistant preupgrade-assistant-contents;
-
Run the preupg -l command to analyze the upgrade feasibility. The command takes several to dozens of minutes. If preupg: error: [2] Errno No to the file or directory: ‘/ root/preupgrade/result. HTML’ mistakes, please refer to the first step to install openscap older;
-
Install version 7.2 using tsinghua University’s centos-Vault source: Centos – upgrade – tool – cli – 7 – instrepo=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.2.1511/os/x86_64/ network.
** The latest version supports the upgrade. Downloading failed: invalid data in. Treeinfo: No section: ‘checksums’ error message appears when upgrading other versions.
-
If the upgrade succeeds, run the reboot command to restart the OS. If errors such as The Requested URL Returned Error: 404 Not Found are displayed, The current system does Not support direct upgrade. Take the high road with the reinstallation system, boy!
-
After the system restarts, SSH cannot be started or grep cannot be used normally due to library dependence. Basic skills are good enough manual investigation, and then solve problems one by one; Do not understand the reason for the error or feel that the handling of trouble, backup data after reinstall the system!
-
Use the RPM – qa | grep el6 check system on residual software. If you can manually clean up, let the system update barrier-free, patience to deal with one by one. If you feel that dependency is too cumbersome or difficult to handle, back up your data and reinstall your system.
reference
- Blog.51cto.com/moerjinrong…