9.2. Working with Packages
9.2.1. Searching Packages
yumsearchterm…
Example 9.4. Searching for packages matching a specific string
~]$ yum search vim gvim emacs
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
============================= N/S matched: vim ==============================
vim-X11.x86_64 : The VIM version of the vi editor for the X Window System
vim-common.x86_64 : The common files needed by any version of the VIM editor
[output truncated]
============================ N/S matched: emacs =============================
emacs.x86_64 : GNU Emacs text editor
emacs-auctex.noarch : Enhanced TeX modes for Emacs
[output truncated]
Name and summary matches mostly, use "search all" for everything.
Warning: No matches found for: gvimyum search command is useful for searching for packages you do not know the name of, but for which you know a related term. Note that by default, yum search returns matches in package name and summary, which makes the search faster. Use the yum search all command for a more exhaustive but slower search.
Filtering the Results
* (which expands to match any character subset) and ? (which expands to match any single character).
yum command, otherwise the Bash shell will interpret these expressions as pathname expansions, and potentially pass all files in the current directory that match the global expressions to yum. To make sure the glob expressions are passed to yum as intended, use one of the following methods:
- escape the wildcard characters by preceding them with a backslash character
- double-quote or single-quote the entire glob expression.
9.2.2. Listing Packages
yumlistall
yum list glob_expression…Example 9.5. Listing ABRT-related packages
~]$ yum list abrt-addon\* abrt-plugin\*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
abrt-addon-ccpp.x86_64 2.1.11-35.el7 @rhel-7-server-rpms
abrt-addon-kerneloops.x86_64 2.1.11-35.el7 @rhel-7-server-rpms
abrt-addon-pstoreoops.x86_64 2.1.11-35.el7 @rhel-7-server-rpms
abrt-addon-python.x86_64 2.1.11-35.el7 @rhel-7-server-rpms
abrt-addon-vmcore.x86_64 2.1.11-35.el7 @rhel-7-server-rpms
abrt-addon-xorg.x86_64 2.1.11-35.el7 @rhel-7-server-rpmsinstalled keyword. The rightmost column in the output lists the repository from which the package was retrieved.
yumlistinstalledglob_expression…
Example 9.6. Listing all installed versions of the krb package
~]$ yum list installed "krb?-*"
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
krb5-libs.x86_64 1.13.2-10.el7 @rhel-7-server-rpmsyumlistavailableglob_expression…
Example 9.7. Listing available gstreamer plug-ins
~]$ yum list available gstreamer\*plugin\*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Available Packages
gstreamer-plugins-bad-free.i686 0.10.23-20.el7 rhel-7-server-rpms
gstreamer-plugins-base.i686 0.10.36-10.el7 rhel-7-server-rpms
gstreamer-plugins-good.i686 0.10.31-11.el7 rhel-7-server-rpms
gstreamer1-plugins-bad-free.i686 1.4.5-3.el7 rhel-7-server-rpms
gstreamer1-plugins-base.i686 1.4.5-2.el7 rhel-7-server-rpms
gstreamer1-plugins-base-devel.i686 1.4.5-2.el7 rhel-7-server-rpms
gstreamer1-plugins-base-devel.x86_64 1.4.5-2.el7 rhel-7-server-rpms
gstreamer1-plugins-good.i686 1.4.5-2.el7 rhel-7-server-rpmsListing Repositories
yumrepolist
-v option. With this option enabled, information including the file name, overall size, date of the last update, and base URL are displayed for each listed repository. As an alternative, you can use the repoinfo command that produces the same output.
yumrepolist-v
yumrepoinfo
yumrepolistall
disabled as a first argument, you can reduce the command output to disabled repositories. For further specification you can pass the ID or name of repositories or related glob_expressions as arguments. Note that if there is an exact match between the repository ID or name and the inserted argument, this repository is listed even if it does not pass the enabled or disabled filter.
9.2.3. Displaying Package Information
yuminfopackage_name…
Example 9.8. Displaying information on the abrt package
~]$ yum info abrt
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
Name : abrt
Arch : x86_64
Version : 2.1.11
Release : 35.el7
Size : 2.3 M
Repo : installed
From repo : rhel-7-server-rpms
Summary : Automatic bug detection and reporting tool
URL : https://fedorahosted.org/abrt/
License : GPLv2+
Description : abrt is a tool to help users to detect defects in applications and
: to create a bug report with all information needed by maintainer to fix
: it. It uses plugin system to extend its functionality.yum info package_name command is similar to the rpm -q --info package_name command, but provides as additional information the name of the yum repository the RPM package was installed from (look for the From repo: line in the output).
Using yumdb
yumdbinfopackage_name
user indicates it was installed by the user, and dep means it was brought in as a dependency).
Example 9.9. Querying yumdb for information on the yum package
~]$ yumdb info yum
Loaded plugins: langpacks, product-id
yum-3.4.3-132.el7.noarch
changed_by = 1000
checksum_data = a9d0510e2ff0d04d04476c693c0313a11379053928efd29561f9a837b3d9eb02
checksum_type = sha256
command_line = upgrade
from_repo = rhel-7-server-rpms
from_repo_revision = 1449144806
from_repo_timestamp = 1449144805
installed_by = 4294967295
origin_url = https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/Packages/yum-3.4.3-132.el7.noarch.rpm
reason = user
releasever = 7Server
var_uuid = 147a7d49-b60a-429f-8d8f-3edb6ce6f4a1yumdb command, see the yumdb(8) manual page.
9.2.4. Installing Packages
root:
yuminstallpackage_name
root:
yuminstallpackage_name package_name…
yuminstallpackage_name.arch
Example 9.10. Installing packages on multilib system
i686 architecture, type:
~]#yuminstallsqlite.i686
root:
yuminstallglob_expression…
Example 9.11. Installing all audacious plugins
~]#yuminstallaudacious-plugins-\*
yum install. If you know the name of the binary you want to install, but not its package name, you can give yum install the path name. As root, type:
yum install /usr/sbin/named/usr/sbin/named, if any, and prompts you as to whether you want to install it.
yum install command does not require strictly defined arguments. It can process various formats of package names and glob expressions, which makes installation easier for users. On the other hand, it takes some time until yum parses the input correctly, especially if you specify a large number of packages. To optimize the package search, you can use the following commands to explicitly define how to parse the arguments:
yum install-n nameyum install-na name.architectureyum install-nevra name-epoch:version-release.architectureinstall-n, yum interprets name as the exact name of the package. The install-na command tells yum that the subsequent argument contains the package name and architecture divided by the dot character. With install-nevra, yum will expect an argument in the form name-epoch:version-release.architecture. Similarly, you can use yum remove-n, yum remove-na, and yum remove-nevra when searching for packages to be removed.
Note
named binary, but you do not know in which bin/ or sbin/ directory the file is installed, use the yum provides command with a glob expression:
~]# yum provides "*bin/named"
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
32:bind-9.9.4-14.el7.x86_64 : The Berkeley Internet Name Domain (BIND) DNS
: (Domain Name System) server
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/sbin/namedyum provides "*/file_name" is a useful way to find the packages that contain file_name.
Example 9.12. Installation Process
root:
~]# yum install httpd
Loaded plugins: langpacks, product-id, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-12.el7 will be updated
---> Package httpd.x86_64 0:2.4.6-13.el7 will be an update
--> Processing Dependency: 2.4.6-13.el7 for package: httpd-2.4.6-13.el7.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-12.el7 will be updated
---> Package httpd-tools.x86_64 0:2.4.6-13.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================ Package Arch Version Repository Size ================================================================================ Updating: httpd x86_64 2.4.6-13.el7 rhel-x86_64-server-7 1.2 M Updating for dependencies: httpd-tools x86_64 2.4.6-13.el7 rhel-x86_64-server-7 77 k Transaction Summary ================================================================================ Upgrade 1 Package (+1 Dependent package) Total size: 1.2 M Is this ok [y/d/N]:
y (yes) and N (no) options, you can choose d (download only) to download the packages but not to install them directly. If you choose y, the installation proceeds with the following messages until it is finished successfully.
Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : httpd-tools-2.4.6-13.el7.x86_64 1/4 Updating : httpd-2.4.6-13.el7.x86_64 2/4 Cleanup : httpd-2.4.6-12.el7.x86_64 3/4 Cleanup : httpd-tools-2.4.6-12.el7.x86_64 4/4 Verifying : httpd-2.4.6-13.el7.x86_64 1/4 Verifying : httpd-tools-2.4.6-13.el7.x86_64 2/4 Verifying : httpd-tools-2.4.6-12.el7.x86_64 3/4 Verifying : httpd-2.4.6-12.el7.x86_64 4/4 Updated: httpd.x86_64 0:2.4.6-13.el7 Dependency Updated: httpd-tools.x86_64 0:2.4.6-13.el7 Complete!
yum localinstall path9.2.5. Downloading Packages
... Total size: 1.2 M Is this ok [y/d/N]: ...
d option, yum downloads the packages without installing them immediately. You can install these packages later offline with the yum localinstall command or you can share them with a different device. Downloaded packages are saved in one of the subdirectories of the cache directory, by default /var/cache/yum/$basearch/$releasever/packages/. The downloading proceeds in background mode so that you can use yum for other operations in parallel.
9.2.6. Removing Packages
root:
yumremovepackage_name…
Example 9.13. Removing several packages
~]# yum remove toteminstall, remove can take these arguments:
- package names
- glob expressions
- file lists
- package provides
Warning

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.