11.5. 切换到更新的流
当您切换到后期模块流时,所有对应的软件包都被后期版本替代。
重要
备份您的数据,并按照特定于组件的迁移说明进行操作。
先决条件
- 这个系统已被完全更新。
流程
将安装的组件切换到新版本,并选择模块(组件)和流(版本):
# dnf module switch-to <module:stream>
例如,要从
nodejs:18
模块流切换到nodejs:20
流,请输入:# dnf module switch-to nodejs:20 ... Dependencies resolved. ======================================================================================== Package Arch Version Repository Size ======================================================================================== Upgrading: nodejs x86_64 1:20.5.1-1.module+el9.3.0+19646+9a702805 rhel-AppStream 14 M nodejs-docs noarch 1:20.5.1-1.module+el9.3.0+19646+9a702805 rhel-AppStream 8.0 M nodejs-full-i18n x86_64 1:20.5.1-1.module+el9.3.0+19646+9a702805 rhel-AppStream 8.5 M npm x86_64 1:9.8.0-1.20.5.1.1.module+el9.3.0+19646+9a702805 rhel-AppStream 2.6 M Switching module streams: nodejs 18 -> 20
您还可以从非模块内容切换到模块流。例如,要从非模块 PHP 8.0 切换到模块 PHP 8.1,请输入:
# dnf module switch-to php:8.1 ... Dependencies resolved. ======================================================================================== Package Arch Version Repository Size ======================================================================================== Upgrading: php-common x86_64 8.1.14-1.module+el9.2.0+17911+b059dfc2 rhel-AppStream 687 k Enabling module streams: php 8.1
可选:将已安装的组件切换到新版本,然后选择要安装的配置文件:
# dnf module switch-to <module:stream/profile>
验证
验证已安装的组件是否已切换到新版本(
[e]
):$ dnf module list nodejs ... rhel-AppStream Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime nodejs 20 [e] common [d] [i], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled