How to Check if a Package is Available in Yum?

Yum (short for “Yellowdog Updater, Modified”) is a package manager for Red Hat and CentOS Linux systems, i.e., apt in Debian/Ubuntu based distros. It is utilized to install, remove and update packages on these systems.

While using a package manager on any  Linux distribution, the users can check for the availability of packages and their detailed information.

This post will list the possible methods to check the availability of packages in Yum. The content that demonstrates the guideline is mentioned below:

Let’s start the article using the “yum list” command.

Using the “yum list” Command

The package manager “yum” uses the “yum list” command to list all available packages that can be installed with yum. The “grep” command also searches for a particular package in the list. The syntax of using “yum list” with “grep” is provided below.

$ yum list | grep <package-name>

Example: Check a Specific Available Package

Let’s check the package “python.x84_64” in the default repository of CentOS using the above-stated syntax.

$ yum list | grep python.x86_64

As the grep is used, so all the packages matching the names are printed with the version information as well.

Note: If the package is not found, the command will return no output.

Using the “yum info” Command

The “yum info” is another useful utility to check the availability of the package in a detailed way. It checks whether a particular package is available or not. Also, it displays complete information regarding a package, including whether it is available for installation. The syntax of the “yum info” command is.

$ yum info <package-name>

Check a Specific Available Package

Let’s check the “zib.x84_64” package using the “yum info” command:

$ yum info zib.x86_64

The output shows that the package is available and displays information about the package, such as its name, version, release, size, and description.

Display All Available Packages

To display all available packages, the “available” utility is used with the “yum list” as follows:

$ yum list available

Note: Yum only works with packages available in the repositories configured on the system. If the package you are looking for is not found, it may not be available in the configured repositories, or it may not be compatible with your version of Linux.

Display a Specific Package From Repository

To display the available packages from the specific repository, specify the name of the repository as below:

$ yum list available | grep epel

The output shows that “epel-release.noarch” is available in yum.

That is all from the guide to checking the available package in Yum.

Conclusion

To check the available package in the Yum package manager, the “yum list” and “yum info” commands are utilized. The “yum list” displays all the available packages after matching the “package name”. The “yum info” commands provide detailed information about specific packages (name, version, release, source, etc). Additionally, users can check the available package in the repository. This article has explained all possible methods to check the available package in Yum.