Management package module flow in RHEL8

CentOS/RHEL application streaming

Reference: https://www.onitroad.com/jc/linux/pkg/pkg-mana/manage-package-module-streams-in-centos-rhel-8.html

CentOS/RHEL 8.0 introduces the concept of Application Streams.
Multiple versions of userspace components shipped with a distribution can now be shipped simultaneously.
They may be updated more frequently than core operating system packages.
This gives us greater flexibility to customize Red Hat Enterprise Linux without affecting the underlying stability of the platform or specific deployment.

Traditionally, managing alternative versions of an application package and its related packages meant maintaining a different repository for each different version.
This creates a management cumbersome situation for developers who need the latest version of their application and administrators who need the most stable version of their application.
Red Hat Enterprise Linux 8 simplifies this process using a new technology called modularization.
Modularity allows a single repository to host multiple versions of an application package and its dependencies.

CentOS/RHEL 8 content is distributed through two main software repositories: BaseOSand 应用程序流 (AppStream).


They are OS

The BaseOS repository provides the core operating system content for Red Hat Enterprise Linux in the form of RPM packages.
The life cycle of BaseOS components is the same as in previous CentOS/RHEL releases.


Application Stream

Application StreamThe repository provides content with different lifecycles in the form of modules and traditional packages.
Application StreamContains essential parts of the system, as well as Red Hat Software Collectionsvarious applications previously offered as part of and other products and programs.

Note: BaseOSand AppStreamare necessary components of the CentOS/RHEL 8 system.

Application StreamThe repository contains two types of content: 模块and traditional RPM packages.
A module describes a set of RPM packages that belong together.
A module can contain multiple streams to make multiple versions of the application available for installation.
Enabling a module stream enables the system to access the RPM packages in the module stream.


Module introduction

A module is a set of RPM packages that belong together as a consistent collection.
Typically, this is organized around a specific version of a software application or programming language.
A typical module can contain a package with an application, a package with application-specific dependencies, a package with application documentation, and a package with helper tools.


Module Streams

Each module can have one or more module streams, and these streams contain different versions of content.
Each stream receives updates independently.
Think of module streams as virtual repositories within the application stream's physical repository.
For each module, only one of its streams can be enabled and its packages available.


Module Profiles

Each module can have one or more configuration files.
A configuration file is a list of certain packages that are installed together for a specific use case (such as server, client, development, minimal installation, or other).
Installing a specific module profile simply installs a specific set of packages from the module stream.
We can then install or uninstall the package normally.
If we do not specify a profile, the module will install its default profile.


Use YUM management module

The new Yum version 4 in CentOS/RHEL 8 adds support for the new modular features of Application Stream.
To handle modular content, the yum module command was added.
Otherwise, yum handles modules just like regular packages.


View module information

# 列出可用的软件包
yum list available

# 为所选软件包搜索可用的 YUM 存储库
yum repoquery 软件包

Commonly used module viewing commands

# 显示哪个模块提供软件包。
## 如果软件包不在任何模块之外,这个命令的输出就为空。
yum module provides package

# 显示模块的详细信息。
yum module info module-name

List modules

# 显示可用模块的列表
yum module list

# 列出特定模块的模块流并检索它们的状态:
yum module list perl

Note: Use the prompts at the end of the output to help determine which flows and profiles are enabled, disabled, installed, and which are the defaults.

# 显示默认模块流的详细信息
yum module info

# 列出默认模块流安装的包:
yum module info perl

Note: When no module flow is specified, details of the default module flow are displayed.

# 使用默认流列出由模块的配置集安装的软件包。
yum module info --profile module-name

# 指定流显示由模块的配置集安装的软件包。
## module-name:stream 格式查看特定的模块流。
## -profile 选项以显示有关每个模块配置文件安装的包的信息。
yum module info --profile perl:5.24

Enable module streaming and install modules

Module streaming must be enabled in order to install their modules.
To simplify this process, when a module is installed, it enables its module streams when necessary.

# 启用模块流
yum module enable module-name:stream

Note: Only one module stream can be enabled for a given module.
Enabling the added module flow will disable the original module flow.

# 使用默认流和配置文件安装模块
yum module install -y perl

NOTE: The same result can be achieved by running yum install @perl.
The @ symbol tells yum that the parameter is a module name rather than a package name.

To verify the status of the module stream and installed configuration files:

# 显示模块的当前状态
yum module list perl

Remove modules and disable module flow

Removing a module removes all packages installed by the configuration files of the currently enabled module stream, as well as any other packages and modules that depend on these.
Packages installed from this module stream are not listed in any of their configuration files, remain installed on the system, and can be removed manually.

Note: Removing modules and switching module streams can be a bit tricky.
Switching a stream enabled by a module is equivalent to resetting the current stream and enabling a new stream.
It does not automatically change any installed packages.
We have to do this manually.
It is not recommended to directly install a module stream that is different from the currently installed module stream, as upgrade scripts may be run during the installation process, which will break the original module stream situation.
This may cause data loss or other configuration issues.
Proceed with caution

To remove an installed module:

# 删除已安装的模块
yum module remove -y perl

After removing a module, module flow remains enabled.
To verify that module streaming is still enabled:

# 移除模块后,模块流仍处于启用状态。
# 要验证模块流是否仍然启用:
yum module list perl

Disable module

# 禁用模块
yum module disable perl

exchange module flow

Switching module streams often requires upgrading or downgrading content to a different version.
To ensure a clean switch, we should first remove the modules provided by the module stream.
This will remove all packages installed by the module configuration file, as well as any modules and packages those packages depend on.

To enable different module streams and install modules:

# 启用不同的模块流并安装模块
yum module install -y perl:5.24

New module streams will be enabled and current streams disabled.
It may be necessary to update or downgrade packages in previous module streams that are not listed in the new configuration file.
If necessary, use yum distro-sync to perform this task.
There may also be packages installed from previous module streams.
Use yum remove to remove them.

Guess you like

Origin blog.csdn.net/omaidb/article/details/131849257