Managing software with YUM

Red Hat Enterprise Linux 9.0 Beta

A guide to managing software with YUM in Red Hat Enterprise Linux 9

Red Hat Customer Content Services

Abstract

This document describes searching, discovering, installing, and using content in the AppStream and BaseOS repositories using the YUM tool in Red Hat Enterprise Linux 9. This includes a description of how to use modules, application streams, and profiles.

RHEL Beta release

Red Hat provides Red Hat Enterprise Linux Beta access to all subscribed Red Hat accounts. The purpose of Beta access is to:

  • Provide an opportunity to customers to test major features and capabilities prior to the general availability release and provide feedback or report issues.
  • Provide Beta product documentation as a preview. Beta product documentation is under development and is subject to substantial change.

Note that Red Hat does not support the usage of RHEL Beta releases in production use cases. For more information, see What does Beta mean in Red Hat Enterprise Linux and can I upgrade a RHEL Beta installation to a General Availability (GA) release?.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.

Providing feedback on Red Hat documentation

We appreciate your input on our documentation. Please let us know how we could make it better. To do so:

  • For simple comments on specific passages:

    1. Make sure you are viewing the documentation in the Multi-page HTML format. In addition, ensure you see the Feedback button in the upper right corner of the document.
    2. Use your mouse cursor to highlight the part of text that you want to comment on.
    3. Click the Add Feedback pop-up that appears below the highlighted text.
    4. Follow the displayed instructions.
  • For submitting more complex feedback, create a Bugzilla ticket:

    1. Go to the Bugzilla website.
    2. As the Component, use Documentation.
    3. Fill in the Description field with your suggestion for improvement. Include a link to the relevant part(s) of documentation.
    4. Click Submit Bug.

Chapter 1. Software management tools in Red Hat Enterprise Linux 9

Throughout this document, YUM and DNF can be used interchangeably.

In Red Hat Enterprise Linux 9, software installation is ensured by the DNF tool. Red Hat continues to support the usage of the yum term for consistency with previous major versions of RHEL. If you type dnf instead of yum, the command works as expected because both are aliases for compatibility.

Note

Although RHEL 8 and RHEL 9 are based on DNF, they are compatible with YUM used in RHEL 7.

Chapter 2. Distribution of content in RHEL 9

The following sections provide an overview of software distribution in Red Hat Enterprise Linux 9:

2.1. Repositories

RHEL 9 content is distributed through the two main repositories: BaseOS and AppStream. Both the BaseOS and AppStream content sets are required for a basic RHEL installation and are available with all RHEL subscriptions. For installation instructions, see the Performing a standard RHEL installation document.

BaseOS
Content in the BaseOS repository is intended to provide the core set of the underlying OS functionality that provides the foundation for all installations. This content is available in the RPM format and is subject to support terms similar to those in previous releases of Red Hat Enterprise Linux.
AppStream
Content in the AppStream repository includes additional user-space applications, runtime languages, and databases in support of the varied workloads and use cases.
CodeReady Linux Builder
The CodeReady Linux Builder repository is available with all RHEL subscriptions. It provides additional packages for use by developers. Packages included in the CodeReady Linux Builder repository are unsupported.

2.2. Application Streams

Multiple versions of user-space components are delivered as Application Streams and updated more frequently than the core operating system packages. This provides greater flexibility to customize RHEL without impacting the underlying stability of the platform or specific deployments.

Each Application Stream component has a given lifecycle, either the same as RHEL 9 or shorter, more suitable to the particular application.

Application Streams are available in the familiar RPM format, as an extension to the RPM format called modules, as Software Collections, or as Flatpaks.

RHEL 9 improves Application Streams experience by providing initial Application Stream versions that can be simply installed as RPM packages by using the traditional yum install command.

Some additional Application Stream versions will be distributed as modules with a shorter lifecycle in future minor RHEL 9 releases.

2.3. Modules

A module is a set of RPM packages that represent a component and are usually installed together. A typical module contains packages with an application, packages with the application-specific dependency libraries, packages with documentation for the application, and packages with helper utilities.

2.4. Module streams

Module streams are filters that can be imagined as virtual repositories in the AppStream physical repository. Module streams represent versions of the AppStream components. Each of the streams receives updates independently.

Module streams can be active or inactive. Active streams give the system access to the RPM packages within the particular module stream, allowing installation of the respective component version. Streams are active if they are explicitly enabled by a user action.

Only one stream of a particular module can be active at a given point in time. Thus only one version of a component can be installed on a system. Different versions can be used in separate containers.

Each module can have a default stream. Default streams make it easy to consume RHEL packages the usual way without the need to learn about modules. The default stream is active, unless the whole module has been disabled or another stream of that module enabled.

Certain module streams depend on other module streams. For example, the perl-App-cpanminus, perl-DBD-MySQL, perl-DBD-Pg, perl-DBD-SQLite, perl-DBI, perl-YAML, and freeradius module streams depend on certain perl module streams.

To select a particular stream for a runtime user application or a developer application, consider the following:

  • Required functionality and which component versions support that functionality
  • Compatibility

For per-component changes, see the Release Notes.

2.5. Module profiles

A profile is a list of recommended packages to be installed together for a particular use case such as for a server, client, development, minimal install, or other. These package lists can contain packages outside the module stream, usually from the BaseOS repository or the dependencies of the stream.

Installing packages by using a profile is a one-time action provided for the user’s convenience. It does not prevent installing or uninstalling any of the packages provided by the module. It is also possible to install packages by using multiple profiles of the same module stream without any further preparatory steps.

Each module stream can have any number of profiles, including none. For any given module stream, some of its profiles can be marked as default and are then used for profile installation actions when no profile is explicitly specified. However, existence of a default profile for a module stream is not required.

Chapter 3. Configuring YUM

The configuration information for YUM and related utilities is stored in the /etc/yum.conf file. This file contains one mandatory [main] section, which enables you to set YUM options that have global effect.

The following sections describe how to:

  • View the current YUM configurations.
  • Set YUM [main] options.
  • Use YUM plug-ins.

3.1. Viewing the current YUM configurations

The following procedure describes how to display the current YUM configuration.

Procedure

  • To display the current values of global yum options specified in the [main] section of the /etc/yum.conf file, use:

    # yum config-manager --dump

3.2. Setting YUM main options

The /etc/yum.conf configuration file contains one [main] section. The key-value pairs in this section affect how YUM operates and treats repositories.

You can add additional options under the [main] section heading in /etc/yum.conf.

For a complete list of available [main] options, see the [main] OPTIONS section of the yum.conf(5) man page.

3.3. Using YUM plug-ins

YUM provides plug-ins that extend and enhance its operations. Certain plug-ins are installed by default.

The following procedures describe how to enable, configure, and disable YUM plug-ins.

3.3.1. Managing YUM plug-ins

The plug-in configuration files always contain a [main] section in which the enabled= option controls whether the plug-in is enabled when you run yum commands. If this option is missing, you can add it manually to the file.

Every installed plug-in has its own configuration file in the /etc/dnf/plugins/ directory. You can enable or disable plug-in specific options in these files.

3.3.2. Enabling and disabling YUM plug-ins

In the YUM v4 version of the YUM tool, plug-ins are enabled by default.

The following procedure describes how to disable or enable all YUM plug-ins, disable all plug-ins for a particular command, or certain YUM plug-ins for a single command.

Procedure

  • To disable or enable all YUM plug-ins, ensure a line beginning with plugins= is present in the [main] section of the /etc/yum.conf file.

    1. To disable all YUM plug-ins, set the value of plugins= to 0.
    2. To enable all YUM plug-ins, set the value of plugins= to 1.

      Important

      Disabling all plug-ins is not advised. Certain plug-ins provide important YUM services and commands. In particular, the product-id and subscription-manager plug-ins provide support for the certificate-based Content Delivery Network (CDN). Disabling plug-ins globally is provided as a convenience option, and is advisable only when diagnosing a potential problem with YUM.

  • To disable all YUM plug-ins for a particular command, append --noplugins option to the command. For example, to disable YUM plug-ins for the update command:

    # yum --noplugins update
  • To disable certain YUM plug-ins for a single command, append --disableplugin=plugin-name option to the command. For example, to disable certain yum plug-ins for the update command:

    # yum update --disableplugin=plugin-name

    Replace plugin-name with the name of the plug-in.

  • To enable certain YUM plug-ins for a single command, append --enableplugin=plugin-name option to the command. For example, to disable certain yum plug-ins for the update command:

    # yum update --enableplugin=plugin-name

    Replace plugin-name with the name of the plug-in.

Chapter 4. Searching for RHEL 9 content

The following sections describe how to locate and examine content in the AppStream and BaseOS repositories in Red Hat Enterprise Linux 9:

4.1. Searching for software packages

This section describes steps needed for finding a package providing a particular application or other content.

Procedure

  • To search for a package, use:

    # yum search term

    Replace term with a term related to the package.

    Note that the yum search command returns term matches within the name and summary of the packages. This makes the search faster and enables you to search for packages you do not know the name of, but for which you know a related term.

  • To include term matches within package descriptions, use:

    # yum search --all term

    Replace term with a term you want to search for in a package name, summary, or description.

    Note that the yum search --all command enables a more exhaustive but slower search.

4.2. Listing software packages

The following procedure describes how to list available packages with yum.

Procedure

  • To list information on all installed and available packages, use:

    # yum list --all
  • To list all packages installed on your system, use:

    # yum list --installed

    Alternatively:

    # yum repoquery --installed
  • To list all packages in all enabled repositories that are available to install, use:

    # yum list --available

    Alternatively:

    # yum repoquery

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in yum input.

4.3. Listing repositories

The following procedure describes how to list repositories with yum.

Procedure

  • To list all enabled repositories on your system, use:

    # yum repolist
  • To list all disabled repositories on your system, use:

    # yum repolist --disabled
  • To list both enabled and disabled repositories, use:

    # yum repolist --all
  • To list additional information about the repositories, use:

    # yum repoinfo

Note that you can filter the results by passing the ID or name of repositories as arguments or by appending global expressions. For more details, see Specifying global expressions in yum input.

4.4. Displaying package information

The following procedure describes how to display package information using yum.

Procedure

  • To display information about one or more available packages, use:

    # yum info package-name

    Replace package-name with the name of the package.

    Alternatively:

    # yum repoquery --info package-name

    Replace package-name with the name of the package.

  • To display information about one or more packages installed on your system, use:

    # yum repoquery --info --installed package-name

    Replace package-name with the name of the package.

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in yum input.

4.5. Listing package groups

The following procedure describes how to list package groups using yum.

  • To view the number of installed and available groups, use:

    # yum group summary
  • To list all installed and available groups, use:

    # yum group list

    Note that you can filter the results by appending command line options for the yum group list command (--hidden, --available). For more available options see the man pages.

  • To list mandatory and optional packages contained in a particular group, use:

    # yum group info group-name

    Replace group-name with the name of the group.

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in yum input.

4.6. Listing available modules

The following procedure describes how to find what modules are available and what their details are using yum.

Procedure

  • To list module streams available to your system:

    # yum module list

    The output of this command lists module streams with name, stream, profiles, and summary on a separate line.

  • To display details about a module, including a description, a list of all profiles, and a list of all provided packages:

    # yum module info module-name
  • To list which of these packages are installed by each of module profiles:

    # yum module info --profile module-name
  • To display the current status of a module, including enabled streams and installed profiles:

    # yum module list module-name
  • To find out which modules provide a specific package:

    # yum module provides package

    If the package is available outside any modules, the output of this command is empty.

Additional resources

4.7. Specifying global expressions in yum input

yum commands allow you to filter the results by appending one or more global expressions as arguments. Global expressions must be escaped when passed as arguments to the yum command.

The following procedure describes two ways to ensure global expressions are passed to yum as intended.

Procedure

  • Double-quote or single-quote the entire global expression:

    # yum provides "*/file-name"

    Replace file-name with the name of the file.

    Note that the file-name must be preceeded either by / or */ character sequence to provide the desired outcome.

  • Escape the wildcard characters by preceding them with a backslash (\) character:

    # yum provides \*/file-name

    Replace file-name with the name of the file.

4.8. Additional resources

Chapter 5. Installing RHEL 9 content

The following sections describe how to install content in Red Hat Enterprise Linux 9:

5.1. Installing packages

The following procedure describes how to install packages using yum.

Procedure

  • Install the package:

    # yum install package-name

    Replace package-name with the name of the package.

    • If the package is not provided by any module stream, this procedure is identical to the procedure used on previous versions of Red Hat Enterprise Linux.
    • If the package is provided by a module stream that is enabled, the package is installed without any further manipulation.
    • If the package is provided by a module stream marked as default, the YUM tool automatically transparently enables that module stream before installing this package.
    • If the package is provided by a module stream that is not active (neither of the above cases), it is not recognized until you manually enable the respective module stream.
  • To install multiple packages and their dependencies simultaneously, use:

    # yum install package-name-1 package-name-2

    Replace package-name-1 and package-name-2 with the names of the packages.

  • When installing packages on a multilib system (AMD64, Intel 64 machine), you can specify the architecture of the package by appending it to the package name:

    # yum install package-name.arch

    Replace package-name.arch with the name and architecture of the package.

  • If you know the name of the binary you want to install, but not the package name, you can use the path to the binary as an argument:

    # yum install /usr/sbin/binary-file

    Replace /usr/sbin/binary-file with a path to the binary file.

    yum searches through the package lists, finds the package which provides /usr/sbin/binary-file, and prompts you as to whether you want to install it.

  • To install a previously-downloaded package from a local directory, use:

    # yum install /path/

    Replace /path/ with the path to the package.

Note that you can optimize the package search by explicitly defining how to parse the argument. See TBD xref:[Specifying a package name in yum input] for more details.

Additional resources

5.2. Installing package groups

The following procedure describes how to install a package group by a group name or by a groupID using yum.

Procedure

  • To install a package group by a group name, use:

    # yum group install group-name

    Replace group-name with the full name of the group or environmental group.

  • To install a package group by a groupID, use:

    # yum group install groupID

    Replace groupID with the ID of the group.

5.3. Installing modular content

This section describes how to install modular content provided by a module stream or a profile.

Default module streams ensure that users can install packages without caring about the modular features. If you want to install a different version of a package from a non-default stream, you must enable the stream before installing the package.

Some modules do not define default streams. In such a case, you must also enable the stream.

Prerequisites

Procedure

  • To enable a module stream:

    # yum module enable module-name:stream

    Replace module-name and stream with names of the module and stream.

    yum asks for confirmation and the stream is enabled and active. If another stream of the module was previously active because it was default, it is no longer active.

  • Install an active module stream (the one you have enabled):

    # yum module install module-name
  • Install a selected module stream:

    # yum module install module-name:stream

    The selected stream is automatically enabled. If a default profile is defined for the stream, this profile is automatically installed.

  • Install a selected profile of the module stream:

    # yum module install module-name:stream/profile

    This enables the stream and installs the recommended set of packages for a given stream (version) and profile (purpose) of the module.

Additional resources

5.4. Running installed content

New commands are usually enabled after you install content from RHEL 9 repositories. If the commands originated from an RPM package or RPM packages were enabled by a module, the experience of using the command should be no different.

Procedure

  • To run the new commands use them directly:

    $ command

5.5. Setting module default streams

In RHEL 9, no module default streams are defined in the repository that contains the modules. You can set a default stream by creating a configuration file in the /etc/dnf/modules.defaults.d/ directory.

The following procedure describes how to set the default stream via the /etc/dnf/modules.defaults.d/ directory.

Prerequisites

Procedure

  1. Create a YAML configuration file in the /etc/dnf/modules.defaults.d/ drop-in directory.

    ---
    document: modulemd-defaults
    version: 1
    data:
      module: <module>
      stream: "<stream>"
      profiles:
        <profile>
        <profile>
    …​

    The output above represents the default definition present for the <module> module at the time of this writing.

  2. To set the default stream to 13, the following configuration can be implemented:

    ---
    document: modulemd-defaults
    version: 1
    data:
      module: <module>
      stream: "13"
      profiles:
        <profile>
        <profile>
    …​

5.6. Additional resources

Chapter 6. Updating RHEL 9 content

YUM allows you to check if your system has any pending updates. You can list packages that need updating and choose to update a single package, multiple packages, or all packages at once. If any of the packages you choose to update have dependencies, they are updated as well.

The following sections describe how to use YUM to update content in Red Hat Enterprise Linux 9:

6.1. Checking for updates

The following procedure describes how to check the available updates for packages installed on your system using yum.

Procedure

  • To see which packages installed on your system have available updates, use:

    # yum check-update

    The output returns the list of packages and their dependencies that have an update available.

6.2. Updating packages

The following procedure describes how to update a single package, a package group, or all packages and their dependencies using yum.

Procedure

  • To update all packages and their dependencies, use:

    # yum update
  • To update a single package, use:

    # yum update package-name

    Replace package-name with the name of the package.

  • To update a package group, use:

    # yum group update group-name

    Replace group-name with the name of the package group.

Important

When applying updates to the kernel, yum always installs a new kernel regardless of whether you are using the yum update or yum install command.

Chapter 7. Automating software updates in RHEL 9

To check and download package updates automatically and regularly, you can use the DNF Automatic tool that is provided by the dnf-automatic package.

DNF Automatic is an alternative command-line interface to YUM that is suited for automatic and regular execution using systemd timers, cron jobs, and other such tools.

DNF Automatic synchronizes package metadata as needed, checks for updates available, and then performs one of the following actions depending on how you configure the tool:

  • Exit
  • Download updated packages
  • Download and apply the updates

The outcome of the operation is then reported by a selected mechanism, such as the standard output or email.

The following sections describe how to automate software updates in Red Hat Enterprise Linux 9:

7.1. Installing DFN Automatic

The following procedure describes how to install the DNF Automatic tool.

Procedure

  • To install the dnf-automatic package, use:

    # yum install dnf-automatic

Verification

  • To verify the successful installation, confirm the presence of the dnf-automatic package by running the following command:

    # rpm -qi dnf-automatic

7.2. DNF Automatic configuration file

By default, DNF Automatic uses /etc/dnf/automatic.conf as its configuration file to define its behavior.

The configuration file is separated into the following topical sections:

  • [commands] section

    Sets the mode of operation of DNF Automatic.

  • [emitters] section

    Defines how the results of DNF Automatic are reported.

  • [command_email] section

    Provides the email emitter configuration for an external command used to send email.

  • [email] section

    Provides the email emitter configuration.

  • [base] section

    Overrides settings from the main configuration file of yum.

With the default settings of the /etc/dnf/automatic.conf file, DNF Automatic checks for available updates, downloads them, and reports the results as standard output.

Warning

Settings of the operation mode from the [commands] section are overridden by settings used by a systemd timer unit for all timer units except dnf-automatic.timer.

7.3. Enabling DNF Automatic

To run DNF Automatic, you always need to enable and start a specific systemd timer unit. You can use one of the timer units provided in the dnf-automatic package, or you can write your own timer unit depending on your needs.

The following procedure describes how to enable DNF Automatic.

Prerequisites

  • You specified the behavior of DNF Automatic by modifying the /etc/dnf/automatic.conf configuration file.

Procedure

  • To select, enable, and start a systemd timer unit that downloads available updates, use:

    # systemctl enable dnf-automatic-download.timer
    
    # systemctl start dnf-automatic-download.timer
  • To select, enable, and start a systemd timer unit that downloads and installs available updates, use:

    # systemctl enable dnf-automatic-install.timer
    # systemctl start dnf-automatic-install.timer
  • To select, enable, and start a systemd timer unit that reports available updates, use:

    # systemctl enable dnf-automatic-notifyonly.timer
    # systemctl start dnf-automatic-notifyonly.timer
  • To select, enable, and start a systemd timer unit that behaves according to settings in the /etc/dnf/automatic.conf configuration file, use:

    # systemctl enable dnf-automatic.timer
    # systemctl start dnf-automatic.timer

    The default behavior of this timer unit is similar to dnf-automatic-download.timer: it downloads the updated packages but does not install them.

  • Optionally, select, enable, and start a systemd timer unit in one command using the --now option. For example:

    # systemctl enable --now dnf-automatic-download.timer
Note

You can also run DNF Automatic by executing the /usr/bin/dnf-automatic file directly from the command line or from a custom script.

Verification

  • To verify that the timer is enabled, run the following command:

    # systemctl status <systemd timer unit>

7.4. Overview of the systemd timer units included in the dnf-automatic package

The systemd timer units take precedence and override the settings in the /etc/dnf/automatic.conf configuration file when downloading and applying updates.

For example if you set:

download_updates = yes

in the /etc/dnf/automatic.conf configuration file, but you have activated the dnf-automatic-notifyonly.timer unit, the packages will not be downloaded.

The dnf-automatic package includes the following systemd timer units:

Table 7.1. systemd timers included in the dnf-automatic package

Timer unitFunctionOverrides settings in the /etc/dnf/automatic.conf file?

dnf-automatic-download.timer

Downloads packages to cache and makes them available for updating.

Note: This timer unit does not install the updated packages. To perform the installation, you must execute the dnf update command.

Yes

dnf-automatic-install.timer

Downloads and installs updated packages.

Yes

dnf-automatic-notifyonly.timer

Downloads only repository data to keep the repository cache up-to-date and notifies you about available updates.

Note: This timer unit does not download or install the updated packages

Yes

dnf-automatic.timer

The behavior of this timer when downloading and applying updates is specified by the settings in the /etc/dnf/automatic.conf configuration file.

Default behavior is the same as for the dnf-automatic-download.timer unit: it downloads packages, but does not install them.

No

Additional resources

Chapter 8. Removing RHEL 9 content

The following sections describe how to remove content in Red Hat Enterprise Linux 9:

8.1. Removing installed packages

The following procedure describes how to remove packages using yum.

Procedure

  • To remove a particular package and all unused dependent packages, use:

    # yum remove package-name

    Replace package-name with the name of the package.

    Note that the package is removed together with any other dependent packages.

  • To remove multiple packages and their unused dependencies simultaneously, use:

    # yum remove package-name-1 package-name-2

    Replace package-name-1 and package-name-2 with the names of the packages.

Note

yum is not able to remove a package without removing dependent packages.

8.2. Removing package groups

The following procedure describes how to remove a package either by the group name or the groupID.

Procedure

  • To remove a package group by the group name, use:

    # yum group remove group-name

    Replace group-name with the full name of the group.

  • To remove a package group by the groupID, use:

    # yum group remove groupID

    Replace groupID with the ID of the group.

8.3. Removing installed modular content

When removing installed modular content, you can remove packages from either a selected profile or the whole stream.

Important

YUM will try to remove all packages with a name corresponding to the packages installed with a profile or a stream, including their dependent packages. Always check the list of packages to be removed before you proceed, especially if you have enabled custom repositories on your system.

8.3.1. Removing packages from an installed profile

When you remove packages installed with a profile, all packages with a name corresponding to the packages installed by the profile are removed. This includes their dependencies, with the exception of packages required by a different profile.

Prerequisites

  • The selected profile has been installed using the yum module install module-name:stream/profile command or as a default profile using the yum install module-name:stream command.
  • You understand modular dependency resolution.

Procedure

  1. Uninstall packages belonging to the selected profile:

    # yum module remove module-name:stream/profile

    Replace module-name, stream, and profile with the module, stream, and profile you wish to uninstall.

    Alternatively, uninstall packages from all installed profiles within a stream:

    # yum module remove module-name:stream

    These operations will not remove packages from the stream that do not belong to any of the profiles.

  2. Check the list of packages under Removing: and Removing unused dependencies: before you proceed with the removal transaction.

To remove all packages from a selected stream, follow instructions in Section 8.3.2 "Removing all packages from a module stream".

8.3.2. Removing all packages from a module stream

When you remove packages installed with a module stream, all packages with a name corresponding to the packages installed by the stream are removed. This includes their dependencies, with the exception of packages required by other modules.

Prerequisites

  • The module stream has been enabled and at least some packages from the stream have been installed.
  • You understand modular dependency resolution.

Procedure

  1. Remove all packages from a selected stream:

    # yum module remove --all module-name:stream

    Replace module-name and stream with the module and stream you wish to uninstall.

  2. Check the list of packages under Removing: and Removing unused dependencies: before you proceed with the removal transaction.
  3. Optionally, reset or disable the stream.

If you want to remove only packages from a selected profile, follow instructions in Section 8.3.1. "Removing packages from an installed profile".

8.4. Additional resources

Chapter 9. Handling package management history

The yum history command allows you to review the following information

  • Timeline of YUM transactions
  • Dates and times the transactions occurred
  • Number of packages affected by the transactions
  • Whether the transactions succeeded or were aborted
  • If the RPM database was changed between transactions

The yum history command can also be used to undo or redo the transactions.

The following section describes how to use yum to handle package management history in Red Hat Enterprise Linux 9:

9.1. Listing transactions

The following procedure describes how to list the latest YUM transactions, the latest operations for a selected package, and details of a particular transaction.

Procedure

  • To display a list of all the latest YUM transactions, use:

    # yum history
  • To display a list of all the latest operations for a selected package, use:

    # yum history list package-name

    Replace package-name with the name of the package. You can filter the command output by appending global expressions. For more details, see Specifying global expressions in yum input.

  • To display details of a particular transaction, use:

    # yum history info transactionID

    Replace transactionID with the ID of the transaction.

9.2. Reverting transactions

The following procedure describes how to revert a selected transaction or the last transaction using yum.

Procedure

  • To revert a particular transaction, use:

    # yum history undo transactionID

    Replace transactionID with the ID of the transaction.

  • To revert the last transaction, use:

    # yum history undo last

Note that the yum history undo command only reverts the steps that were performed during the transaction. If the transaction installed a new package, yum history undo uninstalls it. If the transaction uninstalled a package, yum history undo reinstalls it. The yum history undo command also attempts to downgrade all updated packages to their previous versions, if the older packages are still available.

9.3. Repeating transactions

The following procedure describes how to repeat a selected transaction or the last transaction using yum.

Procedure

  • To repeat a particular transaction, use:

    # yum history redo transactionID

    Replace transactionID with the ID of the transaction.

  • To repeat the last transaction, use:

    # yum history redo last

Note that the yum history redo command only repeats the steps that were performed during the transaction.

Chapter 10. Managing custom software repositories

The configuration information for YUM and related utilities are stored in the /etc/yum.conf file. This file contains one or more [repository] sections, which allow you to set repository-specific options.

It is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory.

Note that the values you define in individual [repository] sections of the /etc/yum.conf file override values set in the [main] section.

The following sections describe how to manage custom software repositories in Red Hat Enterprise Linux 9:

10.1. Setting yum repository options

The /etc/yum.conf configuration file contains the [repository] sections, where repository is a unique repository ID. The [repository] sections allow you to define individual YUM repositories.

Note

Do not give custom repositories names used by the Red Hat repositories to avoid conflicts.

For a complete list of available [repository] options, see the [repository] OPTIONS section of the yum.conf(5) man page.

10.2. Adding a yum repository

To define a new repository, you can either:

  • Add a [repository] section to the /etc/yum.conf file.
  • Add a [repository] section to a .repo file in the /etc/yum.repos.d/ directory.

    YUM repositories commonly provide their own .repo file.

Note

It is recommended to define your repositories in a .repo file instead of /etc/yum.conf as all files with the .repo file extension in this directory are read by yum.

The following procedure describes how to add a yum repository to your system.

Procedure

  • To add a repository to your system, use:

    # yum config-manager --add-repo repository_URL

    Replace repository_url with URL pointing to the repository.

Warning

Obtaining and installing software packages from unverified or untrusted sources other than Red Hat certificate-based Content Delivery Network (CDN) constitutes a potential security risk, and could lead to security, stability, compatibility, and maintainability issues.

10.3. Enabling a yum repository

The following procedure describes how to enable a yum repository added to your system.

Procedure

  • To enable a repository, use:

    # yum-config-manager --enable repositoryID

    Replace repositoryID with the unique repository ID.

To list available repository IDs, see Listing software packages.

10.4. Disabling a yum repository

The following procedure describes how to disable a yum repository added to your system.

Procedure

  • To disable a yum repository, use:

    # yum-config-manager --disable repositoryID

    Replace repositoryID with the unique repository ID.

To list available repository IDs, see Listing software packages.

Chapter 11. Managing versions of application stream content

Content in the AppStream repository can be available in multiple versions, corresponding to module streams. This chapter describes the operations you need to perform when changing the enabled module streams in other ways than only enabling new module streams.

11.1. Modular dependencies and stream changes

Traditionally, packages providing content depend on further packages, and usually specify the desired dependency versions. For packages contained in modules, this mechanism applies as well, but the grouping of packages and their particular versions into modules and streams provides further constraints. Additionally, module streams can declare dependencies on streams of other modules, independent of the packages contained and provided by them.

After any operations with packages or modules, the whole dependency tree of all underlying installed packages must satisfy all the conditions that the packages declare. Additionally, all module stream dependencies must be satisfied.

As a result:

  • Enabling a module stream can require enabling further module streams.
  • Installing a module stream profile or installing packages from a stream can require enabling further module streams and installing further packages.
  • Disabling a module stream can require disabling other module streams. No packages will be removed automatically.
  • Removing a package can require removing further packages. If these packages were provided by modules, the module streams remain enabled in preparation for further installation, even if no packages from these streams are installed any more. This mirrors the behavior of an unused yum repository.

11.2. Interaction of modular and non-modular dependencies

Modular dependencies are an additional layer on top of regular RPM dependencies. Modular dependencies behave similarly to hypothetical dependencies between repositories. This means that installing different packages requires resolution of both the RPM dependencies and the modular dependencies.

The system will always retain the module and stream choices, unless explicitly instructed to change them. A modular package will receive updates contained in the currently enabled stream of the module that provides this package, but will not upgrade to a version contained in a different stream.

11.3. Resetting module streams

Resetting a module is an action that returns all of its streams to their initial state - neither enabled nor disabled. If the module has a default stream, that stream becomes active as a result of resetting the module.

The following procedure describes how to reset a module stream to the initial state using yum.

Procedure

  • Reset the module state:

    # yum module reset module-name

    The module is returned to the initial state. Information about an enabled stream and installed profiles is erased but no installed content is removed.

11.4. Disabling all streams of a module

Modules that have a default stream will always have one stream active. In situations where the content from all the module streams should not be accessible, it is possible to disable the whole module.

The following procedure describes how to disable all streams of a module using yum.

Prerequisites

Procedure

  • Disable the module:

    # yum module disable module-name

    yum asks for confirmation and then disables the module with all its streams. All of the module streams become inactive. No installed content is removed.

Appendix A. YUM commands list

This chapter lists YUM commands for listing, installing, and removing content in Red Hat Enterprise Linux 9.

A.1. Commands for listing content in RHEL 9

The following table lists the commonly used YUM commands for finding content and its details in RHEL 9:

CommandDescription

yum search term

Search for a package using term related to the package

yum repoquery package

Search available YUM repositories for a selected package

yum list --all

List information on all installed and available packages

yum list --installed

yum repoquery --installed

List all packages installed on your system

yum list available

yum repoquery

List all packages in all enabled repositories that are available to install

yum repolist

List all enabled repositories on your system

yum repolist --disabled

List all disabled repositories on your system

yum repolist --all

List both enabled and disabled repositories

yum repoinfo

List additional information about the repositories

yum info package-name

yum repoquery --info package_name

Display details of an available package

yum repoquery --info --installed package_name

Display details of a package installed on your system

yum module list

List available modules

yum module info module-name

Display details of a module

yum module info --profile module-name

List packages installed by profiles of a module using the default stream

yum module list module-name

Display the current status of a module

yum module provides package

Determine which modules provide a package.

Note that if the package is available outside any modules, the output of this command is empty.

yum module info --profile module-name:stream

Display packages installed by profiles of a module using a specified stream

yum group summary

View the number of installed and available groups

yum group list

List all installed and available groups

yum group info group-name

List mandatory and optional packages contained in a particular group

A.2. Commands for installing content in RHEL 9

The following table lists the commonly used YUM commands for installing content in RHEL 9:

CommandDescription

yum install package-name

Install a package.

If the package is provided by a module stream, yum resolves the required module stream, and enables it automatically while installing this package. This also happens recursively for all package dependencies. If more module streams satisfy the requirement, the default ones are used.

yum install package-name-1 package-name-2

Install multiple packages and their dependencies simultaneously

yum install package-name.arch

Specify the architecture of the package by appending it to the package name when installing packages on a multilib system (AMD64, Intel 64 machine)

yum install /usr/sbin/binary-file

Install a binary using the path to this binary as an argument

yum install /path/

Install a previously-downloaded package from a local directory

yum module enable module-name

Enable a module using its default stream.

Enable the module when you want to make the packages available to the system but do not currently want to install any of them.

Some modules might not define default streams. In such cases, you must explicitly specify the stream.

yum module enable module-name:stream

Enable a module using a specific stream.

If the module defines a default stream, you can omit the stream and colon.

yum module install module-name

Install a module using the default stream and profiles

Note that some modules do not define default streams.

yum module install module-name:stream

Install a module using a specific stream and default profiles

yum module install module-name:stream/profile

Install a module using a specific stream and profile

yum group install group-name

Install a package group by a group name

yum group install groupID

Install a package group by the groupID

A.3. Commands for removing content in RHEL 9

The following table lists the commonly used YUM commands for removing content in RHEL 9:

CommandDescription

yum remove package-name

Remove a particular package and all dependent packages

yum remove package-name-1 package-name-2

Remove multiple packages and their unused dependencies simultaneously

yum group remove group-name

Remove a package group by the group name

yum group remove groupID

Remove a package group by the groupID

yum module remove --all module-name:stream

Remove all packages from an active stream

yum module remove module-name:stream/profile

Remove packages from an installed profile

yum module remove module-name:stream

Remove packages from all installed profiles within a stream

yum module reset module-name

Reset a module to the initial state

yum module disable module-name

Disable a module and all its streams

Legal Notice

Copyright © 2021 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.