In this article we will process upgrade from CentOS 6 to CentOS 7. Operation system CentOS 7 was released right after the main Red Hat Enterprise Linux 7 release. OS includes the same long-waiting feature sets as base RHEL. One of the key features is Systemd and Docker functionality. But the most interesting feature is a possibility to perform upgrades from version 6 to version 7 automatically without the need of the installation images. This upgrade still requires a reboot but this enables upgrading procedures very convenient for servers operated remotely.
Step-by-step upgrade: CentOS 6 to CentOS 7
Let’s start the upgrade to CentOS 7:
What to do first? Yes, do your files/system backups. If you have a cloud server with us just make a few clicks and when backups will be ready follow the next steps are described below:
Then go to the Preupgrade Assistant, which can be run on a system with no harm: preupg just analyses the system and gives hints what to look out for during an upgrade without performing any tasks.
This does a check on the installed system and tries to identify potential issues after the upgrade. It should be run until all tests pass successfully. More info on the preupgrade assistant is available in the RedHat official documentation.
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
Preupgrade Assistant only helps evaluating what problems might come up during the upgrade – the real step must be done with the tool ‘redhat-upgrade-tool-cli’.
$ sudo rpm --import http://isoredirect.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Now go for calling an upgrade tool. You may request the version via URL path:
$ sudo /usr/bin/redhat-upgrade-tool-cli --force --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64 setting up repos... ...
After the reboot the machine updates itself by the downloaded packages. Note that this step does take some time depending on the server performance. You should expect minutes for updates. If the process of upgrading/updating was successful you will see into and login to CentOS 7:
$ cat /etc/os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"