Upgrade Centos 6 to Centos 7
Publisher: Psychz Networks, January 29,2019In spite of available upgrade option, it is highly recommended that you take the backup of your existing data, perform a fresh install with CentOS 7 and copy your previous data from an older version of CentOS. This is because there have been many failures recorded while upgradation and one can lose data during the process. This can happen for many reasons and to name a few, if you are using unofficial repositories, any third party package installed outside the repositories, etc.
Upgrading CentOS 6.x to CentOS 7.x
Step 1.A
Make sure that you have updated your current version of CentOS 6.x to the latest version copy (Should be 6.5 or above).
Note: Move to Step 1.B if your current system is already up to date.
You can perform the update using following command
# yum update
This will upgrade all of your system software as well as their dependencies to the latest version.
Step 1.B
Now once we have the system updated to the latest, we can perform the upgradation. First, you will need to run a program that will scan your system and determine what your upgrade status is. This program is called the 'Preupgrade Assistant
'.
On your command prompt type the following
#
sudo
preupg
The output should be similar to as follows
#
sudo
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.
Do you want to continue? y/n
y
Gathering logs used by
preupgrade
assistant:
All installed packages : 01/10 ...finished (time 00:00s)
All changed
files :
02/10 ...finished (time 00:48s)
Changed config files : 03/10 ...finished (time 00:00s)
All users : 04/10 ...finished (time 00:00s)
...
042/100 ...done (samba shared directories
selinux
)
043/100 ...done (CUPS Browsing/BrowsePoll configuration)
044/100 ...done (CVS Package Split)
...
|samba shared directories
selinux
|notapplicable |
|CUPS Browsing/BrowsePoll configuration |notapplicable |
NOTE: The Preupgrade assistant does not perform the upgradation but only tells you if there will be any issues while performing an upgrade. It is recommended you perform this task to know for sure if the upgradation will be successful.
Step 2
We now move to the next step which is to obtain the CentOS 7 key before we run the final process of upgradation. You can import the key using following command
Step 3
Run the following command to perform the upgradation.
#
sudo
/
usr
/bin/
redhat
-upgrade-tool-
cli
--network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64
After you run the above command, the upgrade process retrieves new Boot Images and downloads the necessary packages and then will ask for a reboot.
The system may perform several reboots during this process and should successfully upgrade the current CentOS to version 7.x.
you can run the following command to check the new version of your system
# cat /etc/centos-release
Sample Output: