Yum Commands Cheat Sheet for RHEL

In this blog, we will learn how to install, update, remove, find packages, manage packages and repositories on Linux systems using YUM (Yellowdog Updater Modified) tool developed by RedHat. This blog also contains a Cheat Sheet of some basic commands of YUM.

What is YUM?

YUM Commands Cheat Sheet

YUM (Yellowdog Updater Modified) is an open-source command-line as well as a graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrators to easily install, update, remove or search software packages on a system. It was developed and released by Seth Vidal under GPL (General Public License) as an open-source, which means anyone can be allowed to download and access the code to fix bugs and develop customized packages. YUM uses numerous third-party repositories to install packages automatically by resolving their dependencies issues.

Following example, usages show the most commonly used options for performing package installation with yum :

Install a Package with YUM

To install a package called Firefox, just run the below command it will automatically find and install all required dependencies for Firefox.

The above command will ask confirmation before installing any package on your system. If you want to install packages automatically without asking any confirmation, use option -y as shown in the below example.

Removing a Package with YUM

To remove a package completely with their all dependencies, just run the following command as shown below.

Same way the above command will ask confirmation before removing a package. To disable confirmation prompt just add option -y as shown in below.

Upgrading a Package using YUM

We can also upgrade any installed package to the latest stable version. For e.g. we’ve to upgrade the version of vsftd. Just run the following command it will automatically resolve all dependencies issues and install them.

Downgrading a Package using YUM

There will be occasions when a program update may have lead to an unstable system due to hardware compatibility issues. For this or whatever the reason, if you want your previous version program back, you need to know how to downgrade the applications.

List Packages using YUM

Use the list function to search for the specific package with name, recently installed, updates available, etc. For example, to search for a package called OpenSSH, use the command.

To list all the installed packages in a system, use the following command.

To list all recently installed packages, use the following command.

Use the following command to list the packages with updates available.

Search for a Package using YUM

If you don’t remember the exact name of the package, then use search function to search all the available packages to match the name of the package you specified. For example, to search all the packages that match the word .

Get Information of a Package using YUM

Say you would like to know the information about a package before installing it. To get information about a package just issue the below command.

List all Dependencies of a Package using YUM

You can check the list of all Dependencies required by a specific package using the following command.

Yum Provides Function

Yum provides function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the /etc/ssh/sshd_config.

Check for Available Updates using Yum

Find how many installed packages on your system have updates available, use the following command to check.

Update System using Yum

To keep your system up-to-date with all security and binary package updates, run the following command. It will install all the latest patches and security updates to your system.

List all available Group Packages

In Linux, number of packages are bundled to a particular group. Instead of installing individual packages with yum, you can install a particular group that will install all the related packages that belong to the group. For example to list all the available groups, just issue following command.

Install a Group Packages

Install a particular package group, use option groups install. For example, to install “Development Tools“, execute the below command.

Update a Group Packages

To update any existing installed group packages, just run the following command as shown below.

Get details of a Group Packages

Display details about a group of packages from the system, just use the below command.

Remove a Group Packages

Delete or remove any existing installed group from the system, just use the below command.

List Enabled Yum Repositories

Get the list of all enabled Yum repositories in your system, use following command.

List all Enabled and Disabled Yum Repositories

The following command will display all enabled and disabled yum repositories on the system.

Interactive Yum Shell

Yum utility provides a custom shell where you can execute multiple commands.

Clean Yum Cache

By default yum keeps all the repository enabled package data in /var/cache/yum/ with each sub-directory, to clean all cached files from enabled repository, you need to run the following command regularly to clean up all the cache and make sure that there is nothing unnecessary space is using.

View History of Yum

To view all the past transactions of yum command, just use the following command.

Related Posts

Leave a comment

WhatsApp us