4.6. 列出可用模块及其内容


通过搜索模块并使用 YUM 显示它们的信息,您可以识别存储库中可用的模块,并在安装模块前选择适当的流。

步骤

  1. 使用以下方法之一列出模块信息:

    • 列出所有可用模块:

      $ 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
      Copy to Clipboard Toggle word wrap

      使用 yum module list <module_name > 命令列出相同的信息,但只列出特定模块。

    • 搜索哪个模块提供了某个软件包:

      $ yum module provides <package_name>
      Copy to Clipboard Toggle word wrap

      例如,要显示哪些模块和配置文件提供了 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
      ...
      Copy to Clipboard Toggle word wrap
  2. 使用以下方法之一列出模块详情:

    • 列出模块的所有详情,包括描述、所有配置文件的列表以及模块提供的所有软件包的列表:

      $ yum module info <module_name>
      Copy to Clipboard Toggle word wrap

      例如,要显示 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
      ...
      Copy to Clipboard Toggle word wrap
    • 列出每个模块配置文件安装了哪些软件包:

      $ yum module info --profile <module_name>
      Copy to Clipboard Toggle word wrap
      注意

      每个配置集会安装不同的软件包集合,包括其依赖性。

      例如,要显示 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
      ...
      Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat