- Yum is the Red Hat package manager that is able to query for information about available packages, fetch packages from repositories, install and uninstall them, and update an entire system to the latest available version.
- Yum performs automatic dependency resolution when updating, installing, or removing packages, and thus is able to automatically determine, fetch, and install all available dependent packages.
- YUM stands for Yellowdog update manager.
- Yum is designed to work with repositories, which are online depots of available software packages.
Yum enables you to check if your system has any updates waiting to be applied. You can list packages that need to be updated and update them as a whole, or you can update a selected individual package.
To see which installed packages on your system have updates available.
sudo yum check-update
Example:
[email protected]:~$ sudo yum check-update Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 0:10:14 ago on Mon 09 Aug 2021 08:36:39 AM UTC. NetworkManager.x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms NetworkManager-cloud-setup.x86_64 1:1.30.0-9.el8_4 rhel-8-appstream-rhui-rpms NetworkManager-libnm.x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms NetworkManager-team.x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms NetworkManager-tui.x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms cloud-init.noarch 20.3-10.el8_4.3 rhel-8-appstream-rhui-rpms dhcp-client.x86_64 12:4.3.6-44.el8_4.1 rhel-8-baseos-rhui-rpms dhcp-common.noarch 12:4.3.6-44.el8_4.1 rhel-8-baseos-rhui-rpms dhcp-libs.x86_64 12:4.3.6-44.el8_4.1 rhel-8-baseos-rhui-rpms dnf-plugin-subscription-manager.x86_64 1.28.13-3.el8_4 rhel-8-baseos-rhui-rpms glib2.x86_64 2.56.4-10.el8_4 rhel-8-baseos-rhui-rpms kernel.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms kernel-core.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms kernel-modules.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms kernel-tools.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms kernel-tools-libs.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms kexec-tools.x86_64 2.0.20-46.el8_4.1 rhel-8-baseos-rhui-rpms libsss_autofs.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms libsss_certmap.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms libsss_idmap.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms libsss_nss_idmap.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms libsss_sudo.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms libxml2.x86_64 2.9.7-9.el8_4.2 rhel-8-baseos-rhui-rpms lz4-libs.x86_64 1.8.3-3.el8_4 rhel-8-baseos-rhui-rpms microcode_ctl.x86_64 4:20210216-1.20210525.1.el8_4 rhel-8-baseos-rhui-rpms openldap.x86_64 2.4.46-17.el8_4 rhel-8-baseos-rhui-rpms polkit.x86_64 0.115-11.el8_4.1 rhel-8-baseos-rhui-rpms polkit-libs.x86_64 0.115-11.el8_4.1 rhel-8-baseos-rhui-rpms python3-libxml2.x86_64 2.9.7-9.el8_4.2 rhel-8-baseos-rhui-rpms python3-perf.x86_64 4.18.0-305.10.2.el8_4 rhel-8-baseos-rhui-rpms python3-rpm.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms python3-subscription-manager-rhsm.x86_64 1.28.13-3.el8_4 rhel-8-baseos-rhui-rpms python3-syspurpose.x86_64 1.28.13-3.el8_4 rhel-8-baseos-rhui-rpms resource-agents.x86_64 4.1.1-90.el8_4.5 rhui-rhel-8-for-x86_64-highavailability-rhui-rpms rpm.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms rpm-build-libs.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms rpm-libs.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms rpm-plugin-selinux.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms rpm-plugin-systemd-inhibit.x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms rsyslog.x86_64 8.1911.0-7.el8_4.2 rhel-8-appstream-rhui-rpms ruby.x86_64 2.5.9-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms ruby-irb.noarch 2.5.9-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms ruby-libs.x86_64 2.5.9-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-bigdecimal.x86_64 1.3.4-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-did_you_mean.noarch 1.2.0-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-io-console.x86_64 0.4.6-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-json.x86_64 2.1.0-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-openssl.x86_64 2.1.2-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-psych.x86_64 3.0.2-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygem-rdoc.noarch 6.0.1.1-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms rubygems.noarch 2.7.6.3-107.module+el8.4.0+10822+fe4fffb1 rhel-8-appstream-rhui-rpms sssd-client.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms sssd-common.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms sssd-kcm.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms sssd-nfs-idmap.x86_64 2.4.0-9.el8_4.1 rhel-8-baseos-rhui-rpms subscription-manager.x86_64 1.28.13-3.el8_4 rhel-8-baseos-rhui-rpms subscription-manager-rhsm-certificates.x86_64 1.28.13-3.el8_4 rhel-8-baseos-rhui-rpms systemd.x86_64 239-45.el8_4.2 rhel-8-baseos-rhui-rpms systemd-libs.x86_64 239-45.el8_4.2 rhel-8-baseos-rhui-rpms systemd-pam.x86_64 239-45.el8_4.2 rhel-8-baseos-rhui-rpms systemd-udev.x86_64 239-45.el8_4.2 rhel-8-baseos-rhui-rpms tuned.noarch 2.15.0-2.el8_4.1 rhel-8-baseos-rhui-rpms
You can choose to update a single package, multiple packages, or all packages at once. If any dependencies of the package or packages you update have updates available themselves, then they are updated too.
To update a single package.
sudo yum update <package_name>
Example:
ec2-user@ip-172-31-X-X:~$ sudo yum update rpm.x86_64 Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 0:44:16 ago on Mon 09 Aug 2021 08:36:39 AM UTC. Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Upgrading: python3-rpm x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 158 k rpm x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 542 k rpm-build-libs x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 155 k rpm-libs x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 339 k rpm-plugin-selinux x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 76 k rpm-plugin-systemd-inhibit x86_64 4.14.3-14.el8_4 rhel-8-baseos-rhui-rpms 77 k Transaction Summary ============================================================================================================================================================================== Upgrade 6 Packages Total size: 1.3 M Is this ok [y/N]: y
Multiple packages can be specified, separated by a space.
sudo yum update <package_name_1> <package_name_2> <package_name_3>
Example:
ec2-user@ip-172-31-X-X:~$ sudo yum update rsyslog.x86_64 NetworkManager.x86_64 Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 0:48:40 ago on Mon 09 Aug 2021 08:36:39 AM UTC. Dependencies resolved. ============================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================== Upgrading: NetworkManager x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms 2.6 M NetworkManager-cloud-setup x86_64 1:1.30.0-9.el8_4 rhel-8-appstream-rhui-rpms 177 k NetworkManager-libnm x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms 1.8 M NetworkManager-team x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms 145 k NetworkManager-tui x86_64 1:1.30.0-9.el8_4 rhel-8-baseos-rhui-rpms 328 k rsyslog x86_64 8.1911.0-7.el8_4.2 rhel-8-appstream-rhui-rpms 732 k Transaction Summary ============================================================================================================================================================================== Upgrade 6 Packages Total download size: 5.7 M Is this ok [y/N]: y
To do so, select the "--downloadonly" option at the download prompt and "--downloaddir=" optinon to specified directory where you want to downlad the rpm file of the package.
sudo yum install --downloadonly --downloaddir=<directory> <package_name>
The maintainer of the repositories copies update packages to the repositories. The index in the repositories always contains the current version of a package in the repositories. On the local machine also, a database is available with the current version of the packages that are used. When using the yum update command, current versions of packages that are installed are compared to the version of these packages in the repositories. While updating packages the old version of the packages is replaced with a newer version of the package. There is one exception, which is for the kernel packages. Even if you are using the yum update kernel command. The kernel package is not updated, but the newer kernel is installed beside the old kernel so that while booting you can select the kernel that you want to use.
Yum always installs a new kernel regardless of whether you are using the
sudo yum update
orsudo yum install
command.When using RPM, on the other hand, it is important to use the
sudo rpm -i kernel
command which installs a new kernel instead ofsudo rpm -u kernel
which replaces the current kernel..
To update a package group:
sudo yum group update <group_name>
To update all packages and their dependencies, use the yum update command without any arguments.
sudo yum update
If packages have security updates available, you can update only these packages to their latest versions.
sudo yum update --security
You can also update packages only to versions containing the latest security updates.
sudo yum update-minimal --security
For example, assume that:
- the kernel-3.10.0-1 package is installed on your system;
- the kernel-3.10.0-2 package was released as a security update;
- the kernel-3.10.0-3 package was released as a bug fix update. Then sudo yum update-minimal --security updates the package to kernel-3.10.0-2, and sudo yum update -- security updates the package to kernel-3.10.0-3.
Yum enables you to perform a complete set of operations with software packages, including searching for packages, viewing information about them, installing and removing.
You can search all RPM package names, descriptions and summaries.
sudo yum search <package_name>
Or you can use the 'yum search all' command for a all possibilities.
sudo yum search all <package_name>
Example:
ec2-user@ip-172-31-X-X:~$ sudo yum search vim Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 2:21:55 ago on Tue 10 Aug 2021 11:36:39 AM UTC. ================================================================================ Name & Summary Matched: vim ================================================================================ vim-X11.x86_64 : The VIM version of the vi editor for the X Window System - GVim vim-common.x86_64 : The common files needed by any version of the VIM editor vim-enhanced.x86_64 : A version of the VIM editor which includes recent enhancements vim-filesystem.noarch : VIM filesystem layout vim-minimal.x86_64 : A minimal version of the VIM editor '''
All of yum’s list commands allow you to filter the results by appending one or more glob expressions as arguments. Glob expressions are normal strings of characters that contain one or more of the wildcard characters * (which expands to match any character subset) and ? (which expands to match any single character).
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.
Show the list of the packages that are available, including the repository they were installed from.
- If a repository name is shown, the package is available in that specific repository.
- If @anaconda is listed, the package has already been installed on this system.
sudo yum list all
Example:
ec2-user@ip-172-31-X-X:~$ sudo yum list all Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 3:51:31 ago on Thu 12 Aug 2021 09:00:46 AM UTC. Installed Packages NetworkManager.x86_64 1:1.30.0-9.el8_4 @rhel-8-baseos-rhui-rpms NetworkManager-cloud-setup.x86_64 1:1.30.0-9.el8_4 @rhel-8-appstream-rhui-rpms NetworkManager-libnm.x86_64 1:1.30.0-9.el8_4 @rhel-8-baseos-rhui-rpms NetworkManager-team.x86_64 1:1.30.0-9.el8_4 @rhel-8-baseos-rhui-rpms NetworkManager-tui.x86_64 1:1.30.0-9.el8_4 @rhel-8-baseos-rhui-rpms acl.x86_64 2.2.53-1.el8 @anaconda audit.x86_64 3.0-0.17.20191104git1c2f876.el8 @anaconda audit-libs.x86_64 3.0-0.17.20191104git1c2f876.el8 @anaconda authselect.x86_64 1.2.2-2.el8 @anaconda authselect-compat.x86_64 1.2.2-2.el8 @koji-override-1 authselect-libs.x86_64 1.2.2-2.el8 @anaconda autogen-libopts.x86_64 5.18.12-8.el8 @koji-override-1 avahi-libs.x86_64 0.7-20.el8 @anaconda basesystem.noarch 11-5.el8 @anaconda bash.x86_64 4.4.20-1.el8_4 @anaconda bind-export-libs.x86_64 32:9.11.26-4.el8_4 @anaconda brotli.x86_64 1.0.6-3.el8 @anaconda bzip2.x86_64 1.0.6-26.el8 > @anaconda
To list installed and available packages that match inserted glob expressions.
sudo yum list <glob_expression or package_name>
Example:
Packages with various ABRT add-ons and plug-ins either begin with "abrt-addon-", or "abrt-plugin-".
ec2-user@ip-172-31-X-X:~$ sudo yum list abrt-addon\* abrt-plugin\* Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register. Last metadata expiration check: 0:28:54 ago on Thu 12 Aug 2021 04:53:39 PM UTC. Available Packages abrt-addon-ccpp.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-addon-coredump-helper.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-addon-kerneloops.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-addon-pstoreoops.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-addon-vmcore.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-addon-xorg.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-plugin-machine-id.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms abrt-plugin-sosreport.x86_64 2.10.9-20.el8 rhel-8-appstream-rhui-rpms
Example:
ec2-user@ip-172-X-X-:~$ sudo yum list kernel Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use su bscription-manager to register. Last metadata expiration check: 0:28:17 ago on Thu 12 Aug 2021 04:53:39 PM UTC. Installed Packages kernel.x86_64 4.18.0-305.el8 @anaconda Available Packages kernel.x86_64 4.18.0-305.12.1.el8_4 rhel-8-baseos-rhui-rpms
To list all packages installed on your system use the installed
keyword.
sudo yum list installed <glob_expression>
Example:
List all installed packages that begin with "krb" followed by exactly one character and a hyphen. This is useful when you want to list all versions of certain component as these are distinguished by numbers. The entire glob expression is quoted to ensure proper processing.
ec2-user@ip-172-31-X-X:~$ sudo yum list installed "krb?-*" Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Installed Packages krb5-libs.x86_64 1.18.2-8.el8 @anaconda
To list all packages in all enabled repositories that are available to install.
suod yum list available <glob_expression>
Example:
List all available packages with names that contain "gstreamer" and then "plugin".
ec2-user@ip-172-31-X-X:~$ sudo yum list available gstreamer*plugin\* Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 0:51:46 ago on Thu 12 Aug 2021 04:53:39 PM UTC. Available Packages gstreamer1-plugins-bad-free.i686 1.16.1-1.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-bad-free.x86_64 1.16.1-1.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-base.i686 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-base.x86_64 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-base-devel.i686 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-base-devel.x86_64 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-good.i686 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-good.x86_64 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-good-gtk.i686 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-good-gtk.x86_64 1.16.1-2.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-ugly-free.i686 1.16.1-1.el8 rhel-8-appstream-rhui-rpms gstreamer1-plugins-ugly-free.x86_64 1.16.1-1.el8 rhel-8-appstream-rhui-rpms
To list the repository ID, name, and number of packages for each enabled repository on your system.
sudo yum repolist
To list more information about these repositories, add the -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.
sudo yum repolist -v
sudo yum repoinfo
To list both enabled and disabled repositories use the following command. A status column is added to the output list to show which of the repositories are enabled.
sudo yum repolist all
By passing --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.
To display information about one or more packages.
sudo yum info <package_name>
Example:
ec2-user@ip-172-31-X-X:~$ sudo yum info vim-common Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 1:35:04 ago on Thu 12 Aug 2021 04:53:39 PM UTC. Installed Packages Name : vim-common Epoch : 2 Version : 8.0.1763 Release : 15.el8 Architecture : x86_64 Size : 27 M Source : vim-8.0.1763-15.el8.src.rpm Repository : @System From repo : rhel-8-appstream-rhui-rpms Summary : The common files needed by any version of the VIM editor URL : http://www.vim.org/ License : Vim and MIT Description : VIM (VIsual editor iMproved) is an updated and improved version : of the vi editor. Vi was the first real screen-based editor for : UNIX, and is still very popular. VIM improves on vi by adding : new features: multiple windows, multi-level undo, block : highlighting and more. The vim-common package contains files : which every VIM binary will need in order to run. : : If you are installing vim-enhanced or vim-X11, you'll also need : to install the vim-common package.
The sudo yum info package_name
command is similar to the sudo 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).
You can also query the yum database for alternative and useful information about a package.
sudo yumdb info <package_name>
This command provides additional information about a package, including the check sum of the package (and the algorithm used to produce it, such as SHA-256), the command given on the command line that was invoked to install the package (if any), and the reason why the package is installed on the system (where "user" indicates it was installed by the user, and "dep" means it was brought in as a dependency).
Example:
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-3edb6ce6f4a1
To install a single package and all of its non-installed dependencies (as root or with sudo privileges).
sudo yum install <package_name>
You can also install multiple packages simultaneously by appending their names as arguments.
sudo yum install <package_name> <package_name> <package_name>
If you are installing packages on a multilib system, such as an AMD64 or Intel 64 machine, you can specify the architecture of the package (as long as it is available in an enabled repository) by appending .arch to the package name.
sudo yum install <package_name.arch>
Example: Installing packages on multilib system.
To install the sqlite package for the i686 architecture, type:
sudo yum install sqlite.i686