跳转到内容
搜索 AlmaLinux 文档

    浏览当前文档目录

    AlmaLinux 10:从 module stream 到版本化包名

    • EL9 侧:almalinux:9 容器,AppStream 模块元数据完整;
    • EL10 侧:AlmaLinux 10.2 虚拟机(dnf 4.20.0)与 almalinux:10 容器。

    两侧都执行了 dnf module list、dnf module list nodejs、dnf module enable,并用 dnf list --available 找替代包。

    日志:plans/content-expansion/evidence/logs/module-streams-el9-el10.log。

    $ dnf module list
    mariadb 10.11 client, galera, server [d] MariaDB Module
    mariadb 11.8 client, galera, server [d] MariaDB Module
    mysql 8.4 api, client, filter, server [d]
    nginx 1.22 / 1.24 / 1.26 common [d]
    nodejs 18 / 20 / 22 / 24 common [d], development, minimal, s2i
    php 8.1 / 8.2 / 8.3 common [d], devel, minimal

    [d] 表示默认 profile。装出来的包带模块构建标记:

    $ rpm -q nodejs
    nodejs-22.23.2-2.module_el9.8.0+322+f4aa738c.x86_64
    $ dnf module list
    WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
    $ dnf module list nodejs
    WARNING: modularity is deprecated, and functionality will be removed in a future release of DNF5.
    Error: No matching Modules to list
    $ dnf module enable nodejs:20
    Error: Problems in request:
    missing groups or modules: nodejs:20

    注意 EL10 仍是 dnf 4.20,不是 dnf5——所以这不是「新版 dnf 还没实现」,而是模块化本身被放弃了。

    AlmaLinux 10.2:module list 无输出,module enable 报 missing modules

    $ dnf -q list --available 'php8*'
    php8.4.x86_64 8.4.24-1.el10_2 appstream
    php8.4-bcmath.x86_64 8.4.24-1.el10_2 appstream
    EL9EL10
    php 的 8.1 / 8.2 / 8.3 stream默认 php = 8.3;另装 php8.4 并行
    nodejs 18/20/22/24 stream只有 nodejs(22.x)一个轨
    dnf module enable X:Y不存在,改为装对应包名

    好处是简单:包名即版本,dnf list 一眼看清;代价是没有「同一包名切版本」的机制,脚本要重写。

    Terminal window
    grep -rn "module \(enable\|install\|reset\)" /etc/ansible /opt/scripts 2>/dev/null | head
    dnf list --installed | grep -c module_el || true
    dnf -q list --available 'php8*' nodejs 2>/dev/null | head -5

    第一条找出需要改的脚本,第二条确认旧系统里有没有模块包(rpm -q 里的 .module_el9 标记),第三条看新系统提供了哪些版本化包名。

    • 以为 dnf module list 静默是没配仓库:其实警告后面什么都不列才是 EL10 的正常输出;
    • 照抄 EL9 的 Ansible role:dnf: name=@nodejs:20/common 在 EL10 直接失败;
    • 用 --enablerepo 找 stream:EL10 仓库里没有模块元数据,换仓库也找不到;
    • 升级后对比包清单发现「包名变了」:带 .module_el9… 和不带,本质是同一软件的两种打包路径。
    Terminal window
    dnf module list 2>&1 | tail -3
    dnf module enable nodejs:20 2>&1 | tail -2
    dnf -q list --available nodejs 2>/dev/null | head -3

    检查:

    1. 第一条只看到 WARNING,没有表格;
    2. 第二条报 missing groups or modules;
    3. 第三条能列出 nodejs 的具体版本;
    4. 结论:EL10 用包名表达版本,不再用 stream。

    常见问题

    为什么要去掉模块化?

    上游 RHEL 10 移除了模块化,理由是多版本轨增加了仓库与升级复杂度;改由并行安装的版本化包名承担。

    EL9 上的 stream 还能装吗?

    在 EL9 生命周期内可以;一旦升级到 EL10,这些命令必须替换。

    需要 nodejs 18 但 EL10 只有 22 怎么办?

    用容器跑 18,或从 NodeSource 等第三方仓库装;EL10 官方仓库不提供旧大版本。