Hamsa K
Editor
4 min read | 4 years ago

How to Upgrade Centos 7 to Latest Release

update centos 7 to latest release 

If you are using centos 7.0/7.1/7.2/7.3/7./4/7.5/7.6 then you want to upgrade to current latest release 7.7 then you can follow this article unless you are using Cpanel/WHM etc.

Few Major changes in Centos 7.7

  • Python 3 is available. Installing the python3 package gives Python 3.6 interpreter.
  • bind version 9.11
  • chrony version 3.4
  • Linux kernel version 3.10.0-1062.1.1.el7.x86_64

First we will check centos version with the following command.

[root@centos ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)

Step 1: Take backup

Now backup all important files and folders before upgrading for safe side.

1) Backup all databases like Mariadb,Postgresql etc

2) Take backup of configuration files which are located in etc or any other directories etc

3) Backup all website application data 

4) Backup any other important data if any

Step 2: upgrade centos

Now we will upgrade centos server with the following commands.

[root@centos ~]# yum clean all
[root@centos ~]# yum update

Step 3: Reboot server

once update is completed then restart system with below command.

[root@centos ~]# reboot

Now check centos version 

[root@centos ~]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core) 

Its done. 

Exclude package from update (optional)

For example if you want to exclude kernel packages from update then we can use two methods.once is from command line and another is using yu.conf

From command line use below command

yum --exclude=kernel* update

using yum.conf

open /etc/yum.conf file

[root@centos ~]# vi /etc/yum.conf

Add below line at the end of the file under [main] section

exclude=kernel*

sample ouput

[root@centos ~]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
exclude=kernel*

save the file and exit.

Now you can run 'yum update' command and reboot the server and check centos version and kernel version.

 



Warning! This site uses cookies
By continuing to browse the site, you are agreeing to our use of cookies. Read our terms and privacy policy