[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedSeptember 7, 2023

How to Install Updates on CentOS 7.

How To Install Updates On CentOS 7.

In this tutorial, we will show you how to manually update system packages on CentOS 7. The same instructions apply for CentOS 6.

Updating Packages on CentOS

RPM is a packaging system used by Red Hat and its derivatives such as CentOS.

Yum is the default package manager tool in CentOS. It is used to install, remove, download, query and update packages from the official CentOS repositories as well as other third-party repositories.

Before running the update you can check for available updates using the following command:

sudo yum check-update

The output will contain a list of all packages that are available for update:

epel/x86_64/metalink                                                                          |  29 kB  00:00:00
 * base: ro-bucharest-repo.bigstepcloud.com
 * epel: mirror.efect.ro
 * extras: ro-bucharest-repo.bigstepcloud.com
 * updates: ro-bucharest-repo.bigstepcloud.com
base                                                                                          | 3.6 kB  00:00:00
epel                                                                                          | 4.7 kB  00:00:00
extras                                                                                        | 2.9 kB  00:00:00
google-chrome                                                                                 | 1.3 kB  00:00:00
updates                                                                                       | 2.9 kB  00:00:00
(1/3): epel/x86_64/updateinfo                                                                 | 1.0 MB  00:00:00
(2/3): epel/x86_64/primary_db                                                                 | 7.0 MB  00:00:00
(3/3): google-chrome/primary                                                                  | 1.7 kB  00:00:00
google-chrome                                                                                                    3/3

bind-export-libs.x86_64                              32:9.11.4-26.P2.el7_9.14                           updates
bind-libs.x86_64                                     32:9.11.4-26.P2.el7_9.14                           updates
bind-libs-lite.x86_64                                32:9.11.4-26.P2.el7_9.14                           updates
bind-license.noarch                                  32:9.11.4-26.P2.el7_9.14                           updates
bind-utils.x86_64                                    32:9.11.4-26.P2.el7_9.14                           updates
google-chrome-stable.x86_64                          116.0.5845.179-1                                   google-chrome
kernel.x86_64                                        3.10.0-1160.95.1.el7                               updates
kernel-debug-devel.x86_64                            3.10.0-1160.95.1.el7                               updates
kernel-headers.x86_64                                3.10.0-1160.95.1.el7                               updates
kernel-tools.x86_64                                  3.10.0-1160.95.1.el7                               updates
kernel-tools-libs.x86_64                             3.10.0-1160.95.1.el7                               updates
microcode_ctl.x86_64                                 2:2.1-73.16.el7_9                                  updates
python-perf.x86_64                                   3.10.0-1160.95.1.el7                               updates

To update a single package use the yum install command followed by the name of the package you want to update. For example, to update only the curl package you would run:

sudo yum install curl

Yum will give you a summary of the packages that will be updated and prompt you for confirmation. Answer y and the packages will be updated.

Dependencies Resolved

================================================================================
 Package         Arch           Version                   Repository       Size
================================================================================
Updating:
 curl            x86_64         7.29.0-51.el7_6.3         updates         269 k
Updating for dependencies:
 libcurl         x86_64         7.29.0-51.el7_6.3         updates         222 k

Transaction Summary
================================================================================
Upgrade  1 Package (+1 Dependent package)

Total download size: 492 k
Is this ok [y/d/N]:

To update all packages use the yum update command:

sudo yum update

The command will update the repositories and give you a list of all packages that can be updated. When prompted type y to continue.
Prevent Packages From Being Updated

Sometimes you may want to restrict a package from being updated to a newer version. The Yum plugin versionlock allows you to lock packages to a specific version.

The plugin is not installed by default so first, you’ll need to install it:

sudo install yum-plugin-versionlock

During the installation two configuration files will be created on your system, stored in the /etc/yum/pluginconf.d directory. The configuration file versionlock.conf and the file versionlock.list containing the locked packages. By default, no packages are listed in this file.

To lock a version of a package you can either manually add the package name in the file or use the yum versionlock command followed by the package name. For example, to prevent all PHP packages (all packages starting with “php-”) from being updated you would run:

sudo yum versionlock php-*

This will lock the PHP packages to the current version.

Viewing Yum logs

The history of the packages installed and updated with yum is logged in the /var/log/yum file. You can view the latest records using the cat or tail command:

sudo tail /var/log/yum.log

The output will include records about the packages installations and updates:

Sep 23 16:00:04 Installed: 7:squid-3.5.20-12.el7_6.1.x86_64
Sep 31 22:27:16 Updated: libcurl-7.29.0-51.el7_6.3.x86_64
Sep 31 22:27:16 Updated: curl-7.29.0-51.el7_6.3.x86_64

Conclusion

Installing updates and keeping your CentOS system up-to-date is pretty straightforward but if you manage multiple CentOS machines, it may be time-consuming and sometimes you may overlook an important update. The best option is to set up automatic updates.

Keep reading
How to understand TCP/IP protocol.
April 11, 2023

How to understand TCP/IP protocol.

What is TCP? Transmission Control Protocol (TCP) is a communications standard that enables application programs and computing devices to exchange messages over a network. It is designed to send packets across the internet and ensure the successful delivery of data and messages over networks. TCP…

Read article
How to use Locate Command.
April 11, 2023

How to use Locate Command.

How To Use Locate Command. In this article, we will explain how to use the locate command. One of the most common operations when working on Linux is to search for files and directories. There are several commands on Linux systems that allow you to search for files, with find and locate being the…

Read article
how to use cp command.
April 11, 2023

how to use cp command.

How To Use Cp Command. In this article, we will explain how to use the cp command. When working on Linux and Unix systems, copying files and directories is one of the most common tasks you’ll perform on a daily basis. cp is a command-line utility for copying files and directories on Unix and Linux…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00