Operations 12 min read

Mastering yum update: Essential Commands, Options, and Troubleshooting for Linux

This tutorial explains how to use the yum update command on RPM‑based Linux systems, covering basic usage, repository handling, useful options like --nogpgcheck and --exclude, how to roll back updates, troubleshoot failures, and automate notifications with yum‑cron.

ITPUB
ITPUB
ITPUB
Mastering yum update: Essential Commands, Options, and Troubleshooting for Linux

Introduction to yum update

Yum is the package manager for Red Hat, CentOS, and other RPM‑based Linux distributions. The yum update command upgrades all installed packages to the latest versions available in configured repositories.

$ yum update

How yum update works

When executed, yum checks its repositories for newer versions of installed packages, lists the repositories being queried (e.g., AppStream, Base, Extras), and shows a transaction summary with the number of packages to be installed, upgraded, or added.

After reviewing the list, confirm the operation by typing y and pressing Enter. Yum then downloads and installs the updates, which may take time depending on network speed and system load.

Skipping GPG checks

The --nogpgcheck option disables GPG signature verification, useful when installing unsigned packages or when GPG keys are unavailable.

$ yum update --nogpgcheck

Using a local repository

To update from a local repository, place RPM files in a directory (e.g., /root/rpms) and create a repo file in /etc/yum.repos.d:

[MyRepo]
name=My Local Repo
baseurl=file:///root/rpms
enabled=1
gpgcheck=0

Set proper permissions and clear the yum cache before updating:

$ chmod 644 MyRepo.repo
$ yum clean all

Displaying available patches

List security patches without installing them:

$ yum updateinfo list security

Updating a single package

Specify the package name to update only that package (multiple packages can be listed separated by spaces):

$ yum update name-of-package

Excluding packages from updates

Use --exclude (or -x) to prevent specific packages, such as kernel packages, from being updated: $ yum update --exclude=kernel* Multiple exclusions can be combined:

$ yum update --exclude=kernel* --exclude=httpd

Rolling back an update

Each yum operation receives a transaction ID. To undo a recent update, find the ID with yum history and run:

$ yum history undo 7

Cleaning failed updates

If duplicate packages appear after a failed update, remove them with: $ package-cleanup --dupes Always clear yum’s cache first if errors persist:

$ yum clean all

Skipping broken dependencies

When dependency errors occur, continue updating other packages with:

$ yum update --skip-broken

Listing available updates

Run yum update without options to see all available updates, or use yum list updates to list every package in the repositories, even those not installed.

$ yum list updates

Difference between yum check-update and yum list updates

yum list updates

shows all packages with available updates in the repos, while yum check-update only reports updates for packages already installed. yum check-update returns exit code 100 if updates exist, 0 if none, and 1 on error.

$ yum check-update

Automatic update notifications (yum‑cron)

Install and enable yum-cron to receive email notifications about available updates:

$ yum install yum-cron
$ systemctl enable yum-cron.service
$ systemctl start yum-cron.service

Edit /etc/yum/yum-cron.conf to configure email settings and whether updates should be applied automatically.

apply_updates = no
email_from = root@localhost
email_to = [email protected]
email_host = localhost

Network port used by yum

Yum accesses repositories over HTTP, using port 80. Ensure the firewall allows traffic on this port for yum to function.

yum update vs. yum upgrade

Both commands fetch newer packages, but yum upgrade also removes obsolete packages, whereas yum update leaves them installed, making yum update the safer choice for most scenarios. $ yum upgrade Use yum upgrade with caution, as it may remove packages you still need.

Conclusion

This guide provides a comprehensive overview of the yum update workflow, useful options, troubleshooting steps, and automation techniques to keep RPM‑based systems up to date safely.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxcommand-lineyumsystem-updatespackage-management
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.