CentOS 8 update installed packages for security

ADVERTISEMENTS



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.

The procedure to install updates on CentOS:

Open the terminal app. For remote server log in using the ssh command: ssh vivek @ my-centos-8-cloud-server . Show information about available update/packages, run: sudo yum check-update Issue the command sudo yum update to refresh package database and install updates. 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 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.

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

Conclusion

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.

