Linux

Upgrade CentOS 6 to CentOS 7

In this article discuss about Upgrade CentOS 6 to CentOS 7. According to CentOS, version 6 of the operating system reaches the end of its support cycle by the end of November 2020, while version 7 will be supported until June 2024.

Updates and patches from the CentOS community will no longer be available after the CentOS 6 End of Life (EOL) date.

CentOS is a popular GNU/Linux operating system for servers and workstations. It is popular because it is a community-based Red Hat Enterprise Linux distribution (RHEL). When purchasing and configuring a Virtual Private Server, CentOS [ Community ENTerprise Operating System] is frequently an operating system option (VPS). 

CentOS 7 can be installed by performing an in-place upgrade from CentOS 6. However, because CentOS 7 is only a 64-bit operating system, the system being upgraded must be running 64-bit CentOS 6.

Consider the following points before starting the upgradation process from CentOS 6 to CentOS 7.

  • CentOS 6.5 or later versions are required.
  • At least 150MB of free space is required on the boot partition.
  • Make sure root has 2GB of free space.
  • Save routes (route -n) and IPaddress (ip a) configuration details.
  • Take a snapshot/backup of the machine.
  • An Internet (proxy) connection is required.

Procedure for upgradation CentOS 6 to CentOS 7

Step1: CentOS release 6.10 (Final) is running on my machine.

Step2: Create a new repository to install pre-upgrade tool called openscap.

Created new repository called newupgrade.repo in /etc/yum.repos.d .

Upgrade CentOS 6 to CentOS 7
Repository has been created.

 

Step3: Now run yum install https://buildlogs.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm

 

Step4: Above package was installed successfully. In order to prepare the upgradation, install the redhat upgrade tool by using yum install redhat-upgrade-tool preupgrade-assistant-*

 

Step5: Now initiate the pre-upgrade procedure by running preupg command.  

Upgrade CentOS 6 to CentOS 7
                                                                    Run preupg command.

It may take 10-15mints to complete pre-upgrade assistant and output has stored in below mentioned location.

Upgrade CentOS 6 to CentOS 7
                                      results stored in zip format.

 

Step6: Import the GPG-KEY-CentOS-7 key as part of the upgradation using rpm –import http://mirror.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

 

NOTE: Apparently, my proxy server was unable to retrieve the key, however, we can skip this step after installation.

 

Step7: Attach CentOS mirrors to the mirror list as described below. 

  • mkdir -pv /var/tmp/system-newupgrade/base/ /var/tmp/system-newupgrade/extras/ /var/tmp/system-newupgrade/updates/
  • echo http://mirror.centos.org/centos/7/os/x86_64/ >> /var/tmp/system-newupgrade/base/mirrorlist.txt
  • echo http://mirror.centos.org/centos/7/extras/x86_64/ >> /var/tmp/system-newupgrade/extras/mirrorlist.txt
  • echo http://mirror.centos.org/centos/7/updates/x86_64/ >> /var/tmp/system-newupgrade/updates/mirrorlist.txt

 

Step8: We have completed all the pre-upgrade procedures, now we can begin the upgradation by using centos-upgrade-tool-cli –network=7 –instrepo=http://vault.centos.org/7.0.1406/os/x86_64/ command.

Upgrade CentOS 6 to CentOS 7
                                                                        Upgrading to CENTOS 7

 

Upgrade Process will take 30-45mints, after that it requires reboot to complete.

                                               Upgradation will Complete after reboot.

 

Review the Pre-upgrade Results for CentOS 7:

                                                   Reboot will take 20-35mints.
  1. After rebooting the server, you may get libraries file error messages so run ln -s /lib64/libpcre.so.1 /lib64/libpcre.so.0
  2. I faced the issue unable to start sshd service fixed it by running ln -s /lib64/libsasl2.so.3 /lib64/libsasl2.so.2
  3. Check SELinux and firewalld status.

 

conclusion:

As an alternative to an in-place upgrade, consider a fresh install of CentOS 7 if you decide not to do an in-place upgrade.

Here we have given you a brief guide to updating CentOS from CentOS version 6 to Centos 7 along with other necessary information. Leave a comment if you have any queries about Upgrade CentOS 6 to CentOS 7.

Since CentOS8 no longer support better to migrate for Stream

Next PostWSUS Connection Error Reset Server Node Previous PostAdding Memory and CPU with PowerCLI

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *