Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 11. Managing versions of Application Stream content
Content in the AppStream repository can be available in multiple versions, corresponding to module streams. For example, you can install a different version of a module that is already installed on your system.
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. For example, disabling a module stream can require disabling other module streams. No packages will be removed automatically.
Note that the following actions can cause subsequent automatic operations:
- Enabling a module stream can result in enabling further module streams.
- Installing a module stream profile or installing packages from a stream can result in enabling further module streams and installing further packages.
- Removing a package can result in 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.
You cannot enable a stream of a module when another stream of the same module is already enabled. To switch streams, complete the steps in Switching to a later stream. Alternatively, reset the module, and then enable the new stream.
Removing all packages installed from a stream before switching to a different stream prevents the system from reaching states where packages could be installed with no repository or stream that provides them.
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 this module to its initial state - neither enabled nor disabled. If the module has a configured default stream, this stream becomes active as a result of resetting the module.
Resetting the module is useful, for example, if you want to only extract the RPM content from the module without keeping the module enabled. You can use the yum module reset
command after enabling the module and extracting its contents to reset this module to its initial state.
Procedure
Reset the module state:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module reset <module_name>
# 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. If you want to make the content from all module streams of the module inaccessible, you can disable the whole module.
Prerequisites
- You understand the concept of an active module stream.
Procedure
Disable the module:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module disable <module_name>
# yum module disable <module_name>
Replace module-name with the name of the module that you want to disable.
The
yum
command asks for confirmation and then disables the module with all its streams. All of the module streams become inactive. No installed content is removed.
11.5. Switching to a later stream
When you switch to a later module stream, all respective packages are replaced with their later versions.
Back up your data and follow migration instructions specific to the component.
Alternatively, you can remove all the module’s content installed from the current stream, reset the module, and install the new stream.
Prerequisites
- The system is fully updated.
- No packages installed on the system are newer than the packages available in the repository.
Procedure
Determine if your system is prepared for switching to a later stream:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum distro-sync
# yum distro-sync
ImportantThis command must finish with the
Nothing to do. Complete!
. If it instead proposes changes and asks for confirmation, carefully review these changes and consider whether you want to proceed. Run theYUM distro-sync
command repeatedly, if necessary. Alternatively, you can refuse the suggested changes and manually modify your system to a state where the command returnsNothing to do. Complete!
.By checking the
yum distro-sync
result before switching the streams, you prevent making changes to the system that are unrelated to the stream switching because the same command is required as the last step of this procedure.Change the active stream to the later one:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module reset <module-name> yum module enable <module-name>:<new-stream>
# yum module reset <module-name> # yum module enable <module-name>:<new-stream>
Synchronize installed packages to perform the change between streams:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum distro-sync
# yum distro-sync
If this action suggests changes to content outside the streams, review them carefully.
Note-
If certain installed packages depend on the earlier stream, and there is no compatible version in the later stream, YUM reports a dependency conflict. In this case, use the
--allowerasing
option to remove such packages because they cannot be installed together with the later stream because of the missing dependencies. -
When switching
Perl
modules, you must always use the--allowerasing
option because certain packages in the base RHEL 8 installation depend onPerl 5.26
. You need to reinstall binary extensions for interpreted languages, which are typically written in C or C++, after the new stream is enabled. It concerns, for example, packages installed by using the following commands:
-
The
gem
command from theruby
module. For more information, see How to switch Ruby streams in RHEL 8. -
The
npm
command from thenodejs
module -
The
cpan
command from theperl
module -
The
pecl
command from thephp
module
-
The
-
If certain installed packages depend on the earlier stream, and there is no compatible version in the later stream, YUM reports a dependency conflict. In this case, use the
11.6. Defining custom default module streams and profiles
By default, the YUM utility uses the default module streams defined in the repository that contains the modules. You can configure the default stream and default module profile in the /etc/dnf/modules.defaults.d/
directory.
Always consider the module stream’s life cycle.
Prerequisites
- You understand the concept of an active module stream.
Procedure
Display the available streams and their profiles:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module list <module_name>
# yum module list <module_name>
For example, to list the available streams and their profiles of the
postgresql
module, enter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module list postgresql
# yum module list postgresql (…) Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) Name Stream Profiles Summary postgresql 9.6 client, server [d] PostgreSQL server and client module postgresql 10 [d] client, server [d] PostgreSQL server and client module postgresql 12 client, server [d] PostgreSQL server and client module postgresql 13 client, server [d] PostgreSQL server and client module postgresql 15 client, server [d] PostgreSQL server and client module … Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Create a
YAML
configuration file in the/etc/dnf/modules.defaults.d/
drop-in directory.For example, create the
/etc/dnf/modules.defaults.d/postgresql.yaml
file with the following content to define13
as the default stream andserver
as the default profile for thepostgresql
module:Copy to Clipboard Copied! Toggle word wrap Toggle overflow --- document: modulemd-defaults version: 1 data: module: postgresql stream: "13" profiles: 13: [server]
--- document: modulemd-defaults version: 1 data: module: postgresql stream: "13" profiles: 13: [server]
Verification
Verify the default stream and profile settings:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum module list postgresql
# yum module list postgresql (…) Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) Name Stream Profiles Summary postgresql 9.6 client, server PostgreSQL server and client module postgresql 10 client, server PostgreSQL server and client module postgresql 12 client, server PostgreSQL server and client module postgresql 13 [d] client, server [d] PostgreSQL server and client module postgresql 15 client, server PostgreSQL server and client module … Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled