4.6. 列出可用模块及其内容
通过搜索模块并使用 YUM 显示它们的信息,您可以识别存储库中可用的模块,并在安装模块前选择适当的流。
步骤
使用以下方法之一列出模块信息:
列出所有可用模块:
$ yum module list Name Stream Profiles Summary ... nodejs 18 common [d], development, minimal, s2i Javascript runtime postgresql 15 client, server [d] PostgreSQL server and client module ... Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled使用
yum module list <module_name> 命令列出相同的信息,但只列出特定模块。搜索哪个模块提供了某个软件包:
$ yum module provides <package_name>例如,要显示哪些模块和配置文件提供了
npm软件包,请输入:$ yum module provides npm ... npm-1:8.19.4-1.16.20.2.4.module+el8.9.0+21536+8fdee1fb.x86_64 Module : nodejs:16:8090020240315081818:a75119d5:x86_64 Profiles : common development s2i Repo : rhel-AppStream Summary : Javascript runtime ...
使用以下方法之一列出模块详情:
列出模块的所有详情,包括描述、所有配置文件的列表以及模块提供的所有软件包的列表:
$ yum module info <module_name>例如,要显示
nodejs模块的详情,请输入:$ yum module info nodejs ... Name : nodejs Stream : 20 Version : 8090020240228165436 Context : a75119d5 Architecture : x86_64 Profiles : common [d], development, minimal, s2i Default profiles : common Repo : rhel-AppStream Summary : Javascript runtime Description : Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Requires : platform:[el8] Artifacts : nodejs-1:20.11.1-1.module+el8.9.0+21380+12032667.src : nodejs-1:20.11.1-1.module+el8.9.0+21380+12032667.x86_64 ...列出每个模块配置文件安装了哪些软件包:
$ yum module info --profile <module_name>注意每个配置集会安装不同的软件包集合,包括其依赖性。
例如,要显示
nodejs模块的此信息,请输入:$ yum module info --profile nodejs ... Name : nodejs:18:8090020240301110609:a75119d5:x86_64 common : nodejs : npm development : nodejs : nodejs-devel : npm minimal : nodejs s2i : nodejs : nodejs-nodemon : npm ...