24/7/365 Support

Using YUM to search for packages in CentOS

In this process, we will investigate the role of using YUM to find a package. YUM was developed to improve the installation of RPM software packages, and it is used to access a growing list of packages that provide a full range of services offered by your server. YUM is simple to use, but if you are not sure what a package is called, then your duties as the server administrator can become that much harder. To overcome this, YUM maintains an extensive range of discovery tools and it is the purpose of this process to show you how to use this functionality in order to search through the various repositories and find the package you need.

To Start With: What Do You Need?

To complete this process, you will require a working installation of the CentOS 7 operating system with root privileges, a console-based text editor of your choice, and a connection to the Internet.

The Process:

This process will show you how to find one or more packages by invoking YUM’s searching options. To do this, you will need to log in as the root user and complete the following process:

  1. To search for a single package, replace the keyword value with the appropriate phrase, string, or parameter, and type the following:
    yum search keyword
  2. Wait for a summary of the search results, and when a list is generated, you can query any package shown by simply replacing package_name with the appropriate value:
    yum info package_name
  3. If the preceding results prove satisfactory, and you want to view a list of dependencies associated with the package in question, type the following:
    yum deplist package_name

How Does It Work?

Searching for packages with YUM can be achieved in the same way as you would search for anything on the World Wide Web (WWW). The types of words you can search for can be as specific or as general as you like. They can even consist of full or partial words;
having found a package that you may be interested in, you will have noticed that this process has also served to show you how to discover additional information about the package in question.

So, what have we learned from this experience?

YUM maintains extensive search features and it allows you to query packages by keyword, package name, and pathname. For example, if you want to locate the correct package for compiling C, Objective-C, and C++ code, you can use the yum search compiler query. When using these search terms on the command line, there are a number
of related results, and each package carries a brief description that enables us to use a simple process of elimination in order to select the most obvious or the most relevant value. With this in mind, you can then query YUM using the info parameter to find out
more about certain packages. This option reveals the full package details together with a detailed description of what functionality the package is intended to provide. Generally speaking, you may not need to know any further details.

However, there may be circumstances in which you want to know how this package interacts with the server as a whole (especially if you are working with source installations or troubleshooting broken packages), so we can use YUM’s deplist parameter that can give quite a detailed report; if you do happen to have any broken packages, you could simply use this output to detail what dependencies you may or may not need to install in order to fix an underlying issue. This command is particularly useful when debugging dependencies or when working with source-based installations.

There’s More:

Sometimes, you may not want to search for a specific package, and instead, you may prefer to display the contents of your repositories in a catalog-style format. Again, this is easy to do and YUM provides for this functionality with the following commands. If you would like to simply list all the packages available to you from the current repositories used by your system, type yum list all. However, because this list may be quite exhaustive, you may prefer to page through the results by using yum list all | less. In a similar fashion, if you would simply like to list all the software currently installed on your system, type yum list installed | less. If you would like to determine which packages provide for a specific file or feature, simply run the following command at any time by substituting your_filename_here with something more relevant to your own needs: yum provides your_filename_here.

 

Help Category:

What Our Clients Say