How to Check if Package is Installed Using YUM [3 Solutions]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

YUM (Yellowdog Updater Modified) serves as a vital command-line package management tool utilized in Red Hat-based distributions such as RHEL, Fedora, and CentOS. It simplifies package management within Linux/Unix systems, streamlining processes for easy installation, updates, and uninstallation. The task of verifying package installations holds great significance in package management. The YUM package manager seamlessly accomplishes this task. In this article, I will guide you through how to check if an app package is installed using the yum command in Red Hat-based distributions.

Following is a flow chart to check if an rpm package is installed using yum:

step by step processes of how to use YUM package manager to check if an app package is installed in your Red Hat-based system using command line interface (CLI)

[Distro Used Throughout the Tutorial: RHEL 9.2]

2 Methods to Check if a Package is Installed Using YUM

After you install an app package, you need to ensure that the app is installed properly. Using the yum package manager and its different options is a hassle-free process. In this article, I will guide you through the step-by-step process of checking an installed app using yum.

If you want to know how to install app packages using yum check this detailed article on “How to Install RPM Packages Using YUM”. To list all installed app packages using yum check this simple article “How to Show List of Installed Packages Using YUM”.

You can read our Comparative Analysis of Methods to distinguish between these two methods and pick the best one for your needs.

Method 1: Check an App Package Using the LIST Option

You can use the list option of the yum command to check if an app package is installed. The list option is very useful for checking all available and installed app packages in your system using the Command Line Interface (CLI). You can check an installed app directly or you can check it from all installed app packages list.

Case 1: Check for an App Package Directly

If you want to directly check if an app package is installed in your Red Hat-based system using the yum list command, then follow this simple step:

  1. First open your terminal and run the following command to check for an installed app package:

    yum list installed audacity
    EXPLANATION
    • yum: Package manager in Red Hat-based distributions.
    • list: This option can show all available and installed packages in your system.
    • installed: Tells the list option to show the installed packages.
    • audacity: Name of the package I am checking if installed properly.

    check if an app package is installed directly using yum list command

    If the app package you are checking is installed, the results similar to the image above will appear on your terminal.

Case 2: Check for an App Package From All Installed Packages List

You can also check if an app package is installed properly from the list of all installed app packages. In order to do that execute these straightforward tasks:

  1. To begin with type the following command in your terminal:

    yum list installed | grep audacity
    EXPLANATION
    • | (pipe): Pipe is used to redirect the standard output.
    • grep: Grep is used to find a specific pattern or string.
  2. Now, hit ENTER. If the package is installed properly in your system your terminal will look like the following image:

    check if an app package is installed from all installed app packages list using yum list command

Method 2: Check an App Package Using the INFO Option

In Red Hat-based distribution the info option of the yum package manager is very useful. You can use this command to check details about installed app packages in your Linux system. Moreover, it is possible to examine details of packages not yet installed but available for installation from remote repositories. To verify the installation of a particular package, follow these simple steps:

First of all open your terminal and run the following command to check if an app package is installed in your system:

yum info audacity
EXPLANATION
  • info: display more detailed info about your app package.

check if an app package is installed using yum info command

Now, if that specific app is installed in your system, the detailed info section will indicate it as “Installed Packages“.

Note: You can also use “yum-utils” to list all installed app packages. “yum-utils” is a collection of utilities and plugins that extend and supplement the functionality of the yum package manager. To do so run:

sudo yum install yum-utils
sudo yum repoquery -a --installed

Comparative Analysis of Methods

Now, take a look at the following comparison table that illustrates the two discussed methods of using the yum command to check the installation status of an app package in Red Hat-based Linux distributions:

Methods Cases Pros Cons
Method 1 Case 1 Direct and precise result. Need exact package name.
Case 2 Do not need the exact package name. Can show a false positive response with a similar app package name.
Method 2 Case 1 Show comprehensive information about package details. Additional details may be overwhelming for a simple binary check.

Out of all these commands, Case 1 of Method 1 is the most efficient way to check whether a package is installed or not. If you don’t remember the exact name of the app package then use method 1’s case-2. If you also want to check package details then go for method 2.

What Happens if the Package is Not Installed

If the specific app package is not installed in your system, the terminal output will differ from the image demonstrated in the methods above. You will get different responses in those cases. If you are using the yum list command to check for the installed app package then you will see the response shown in the following image:

app package is not installed yum list command

But, when you use the yum info command to check the package’s installation status, the response will resemble the following image:

app package is not installed yum info command

Conclusion

In this article, I have discussed how using different options of the yum package manager you can easily check if a specific app package is installed in your Red Hat-based system. I hope this article will be helpful for you to maintain an up-to-date Linux system.

People Also Ask

How to install a package with yum?

To install a package with yum in any Red Hat-based Linux distributions execute this command sudo yum install Package_name. then provide the sudo user password and press Y to confirm the installation.

How to check available packages in Linux using yum?

To check all available packages for you to install run the following command yum list available in the terminal. It will show a list of all available packages that you can install from remote repositories directly.

Where are Linux packages installed?

To check the location of an installed app package in any Linux/Unix-based operating system,  use which package_name or whereis package_name command. Which command will display the path of the first occurrence of the command found in the PATH variable. Whereis command will display the path of the binary, source, and manual page files of the app package.


Related Articles


<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics

4.8/5 - (17 votes)
Ridoy Chandra Shil

Hello everyone. I am Ridoy Chandra Shil, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Biomedical Engineering graduate from Bangladesh University of Engineering and Technology. I am a science and tech enthusiast. In my free time, I read articles about new tech and watch documentaries on science-related topics. I am also a big fan of “The Big Bang Theory”. Read Full Bio

Leave a Comment