CentOS 8 update installed packages for security

I need to update installed packages for security on CentOS 8.x (CentOS Enterprise Linux) server. How can I update my CentOS 8.x system using yum command? How do you install security Updates on CentOS 8?

Keeping your system, kernel, docker and the installed application is an essential sysadmin task. An updated CentOS 8 system means fewer security issues and increased system stability. CentOS Enterprise Linux 8.x is pretty user-friendly when it comes to applying updates and patches. This page shows how to update CentOS system using the yum command or the GUI tools for desktop installation.

CentOS 8 update installed packages for security

The procedure to install updates on CentOS:

  1. Open the terminal app.
  2. For remote server log in using the ssh command: ssh vivek@my-centos-8-cloud-server.
  3. Show information about available update/packages, run: sudo yum check-update
  4. Issue the command sudo yum update to refresh package database and install updates.
  5. Reboot the system if kernel was updated by typing sudo reboot command.

Let us see all commands and steps in details to apply patches.

Find out info about available security-related updates

It is a good idea to find out if there any updates available for the box. Hence, run the following command:
sudo yum check-update
Sample outputs:

Last metadata expiration check: 0:00:30 ago on Tuesday 17 December 2019 08:05:55 AM UTC.
bash.x86_64                          4.4.19-8.el8_0                                 BaseOS   
dracut.x86_64                        049-10.git20190115.el8_0.1                     BaseOS   
dracut-config-rescue.x86_64          049-10.git20190115.el8_0.1                     BaseOS   
dracut-network.x86_64                049-10.git20190115.el8_0.1                     BaseOS   
dracut-squash.x86_64                 049-10.git20190115.el8_0.1                     BaseOS   
grub2-common.noarch                  1:2.02-66.el8_0.1                              BaseOS   
grub2-pc.x86_64                      1:2.02-66.el8_0.1                              BaseOS   
grub2-pc-modules.noarch              1:2.02-66.el8_0.1                              BaseOS   
grub2-tools.x86_64                   1:2.02-66.el8_0.1                              BaseOS   
grub2-tools-extra.x86_64             1:2.02-66.el8_0.1                              BaseOS   
grub2-tools-minimal.x86_64           1:2.02-66.el8_0.1                              BaseOS   
initscripts.x86_64                   10.00.1-1.el8_0.1                              BaseOS   
kernel.x86_64                        4.18.0-80.11.2.el8_0                           BaseOS   
kernel-core.x86_64                   4.18.0-80.11.2.el8_0                           BaseOS   
kernel-modules.x86_64                4.18.0-80.11.2.el8_0                           BaseOS   
kernel-tools.x86_64                  4.18.0-80.11.2.el8_0                           BaseOS   
kernel-tools-libs.x86_64             4.18.0-80.11.2.el8_0                           BaseOS   
kpartx.x86_64                        0.7.8-7.el8_0.2                                BaseOS   
libnfsidmap.x86_64                   1:2.3.3-14.el8_0.2                             BaseOS   
platform-python.x86_64               3.6.8-4.el8_0                                  BaseOS   
python3-libs.x86_64                  3.6.8-4.el8_0                                  BaseOS   
python3-perf.x86_64                  4.18.0-80.11.2.el8_0                           BaseOS   
python3-rpm.x86_64                   4.14.2-11.el8_0                                BaseOS   
selinux-policy.noarch                3.14.1-61.el8_0.2                              BaseOS   
selinux-policy-targeted.noarch       3.14.1-61.el8_0.2                              BaseOS   
Obsoleting Packages
grub2-tools.x86_64                   1:2.02-66.el8_0.1                              BaseOS

Want to see a list of the updates on screen? Try the following command along with grep command:
sudo yum check-update
sudo yum check-update | more
sudo yum check-update | grep kernel
sudo yum check-update

Before you apply updates please note down Linux kernel version, run:
uname -mrs
Sample outputs:

Linux 4.18.0-80.7.1.el8_0.x86_64 x86_64

How to install updates via yum command line for CentOS 8

Open up a terminal application or log in using ssh command. Run the yum command to upgrade all installed packages on CentOS Linux system:
$ sudo yum update

One can only apply security related updates to the server, run:
sudo yum --security update

How do I update a single package?

Run the following command:
sudo yum update pkg_name
sudo yum update nginx
sudo yum update php
sudo yum update httpd

It is also possible to install all updates except kernel and php packages as follows:
sudo yum -x 'kernel*' -x 'php*' update
The -x option exclude packages specified given name. See “Force yum update Command To Exclude Certain Packages” for more info.

Reboot the Linux system

You must reboot system when CentOS 8.x Linux kernel gets updated, run:
sudo reboot
Verify Linux kernel version and list updates:
uname -mrs
sudo yum check-update

Checking for package updates on CentOS 8


You learned how to install the software update for all installed packages using the GUI and CLI methods on CentOS 8.x based systems. See CentOS yum man page for more information.

This entry is 5 of 6 in the How to keep your Linux system up-to-date Tutorial series. Keep reading the rest of the series:
  1. RHEL 8 update installed packages for security
  2. FreeBSD Applying Security Updates Using pkg/freebsd-update
  3. Amazon Linux AMI update installed packages for security
  4. SUSE 15 update installed packages for security
  5. CentOS 8 update installed packages for security
  6. Ubuntu 20.04 LTS update installed packages for security

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum