April 13, 2020

How to Update Fedora CentOS Redhat from command line using yum

How to Update Fedora CentOS Redhat from command line using yum

To update your  Redhat based distro from the command line use the following commands:

Update with YUM

The basic update command is :

sudo yum update

Type your password, and then click "y" when prompted

Output will similar to the following:

[sudo] password for jcripps: 
Last metadata expiration check: 1:15:16 ago on Mon 13 Apr 2020 07:58:09 AM PDT.
Dependencies resolved.
=====================================================================================================================================================================================================================
 Package                                                           Architecture                             Version                                                  Repository                                 Size
=====================================================================================================================================================================================================================
Upgrading:
 autocorr-en                                                       noarch                                   1:6.3.5.2-5.fc31                                         updates                                   104 k
 code                                                              x86_64                                   1.44.0-1586345467.el7                                    code                                       85 M
 firewalld                                                         noarch                                   0.7.4-1.fc31                                             updates                                   423 k
 firewalld-filesystem                                              noarch                                   0.7.4-1.fc31                                             updates                                   8.9 k
 gjs                                                               x86_64                                   1.58.6-1.fc31                                            updates                                   453 k
 gnome-control-center                                              x86_64                                   3.34.5-1.fc31                                            updates                                   5.6 M
 gnome-control-center-filesystem                                   noarch                                   3.34.5-1.fc31                               

Transaction Summary
=====================================================================================================================================================================================================================
Upgrade  66 Packages

Total download size: 336 M
Is this ok [y/N]: 

To complete your update make sure to reboot your system to apply any kernel changes.

sudo shutdown -r now

After a kernel update you will see the option to select multiple kernels from the grub boot menu.

See below for checking your kernel version.

Updating the kernel generally requires a restart so that it can be loaded back into memory. There are ways to update a kernel without rebooting, such as using Kpatch. But for simplicity reboot your system.

Force Update / Auto Confirmation

To force an update and skip confirmation use -y as follows:

sudo yum update -y

Alternatively you could use

sudo yum update --assumeyes

Update an Individual Application

To update an invidual application type the application name at the end as follows:

sudo yum update slack

Out put will look as follows:

slack_update

Checking the Kernel Version:

It can be useful to check your kernel version before and after updating to ensure you are using the updated kernel.

uname -r

Output will look as follows:

[[email protected] ~]$ uname -r
5.5.15-200.fc31.x86_64

Add -v for extra useful info

uname -rv

Output:

[[email protected] ~]$ uname -rv
5.5.15-200.fc31.x86_64 #1 SMP Thu Apr 2 19:16:17 UTC 2020