Skip to main content

AppStream常用命令

AppStream常用命令

在AppStream中,模块使用module-spec进行描述。module-spec由三部分组成,格式为name:stream/profile(模块名:流名/档案名)。在没有指定stream和profile的情况下,命令会自动选择默认的。需要注意的是,并不是所有的模块都有默认的stream和profile。

  • 命令格式。
dnf module <command> [ 选项 ] <参数>...
  • 常用命令。

表7.1dnf module命令参数说明

命令及参数 说明
dnf module install ... 安装模块中的包。
dnf module update ... 更新已启用的模块的流中的包。
dnf module remove ... 移除模块profile中不被依赖的包。当未指定profile时,移除所有profile中不被依赖的包。
dnf module remove --all ... 在remove的基础上,移除所有流提供的包名,被依赖的包和其他模块中提供同名的包不会被移除。
dnf module enable ... 使模块指定profile的包可用。
dnf module disable ... 使模块中所有流不可用。
dnf module reset ... 使模块恢复默认状态。
dnf module provides ... 列举包含指定包名的所有模块,包含已被禁用的模块。
dnf module list [--all] [module_name...] 列举模块的所有流状态。
dnf module list --enabled [module_name...] 列举模块中被启用的流。
dnf module list --disabled [module_name...] 列举模块中被禁用的流。
dnf module list --installed [module_name...] 列举模块中已安装的流。
dnf module info ... 打印模块的详细信息。
dnf module info [--profile] ... 只打印模块的详细profile信息。
dnf module repoquery ... 列举模块中已启用流的所有可用包。
dnf module repoquery --available ... 列举模块中的所有可用包。
dnf module repoquery --installed ... 列举模块中已安装的包。
  • 执行示例。

执行dnf module list命令,列举所有模块。 ant 1.10[d] common[d] Java build too1 container-too1s ue120 common[d] Tools help you create,deploy,manage,and secure containers. container-tools 1.0 common[d] Tools help you create,deploy,manage,and secure containers. container-tools 2.0 common[d] Tools help you create,deploy, manage,and secure containers. container-tools 3.0[d][e] common[d] Tools help you create,deploy,manage,and secure containers. 2.8[d] common [d],devel gimp gimp module go-toolset ue120[d] common[d] Go golang -ecosystem 1.0[d] common[d] The ecosystem of packages for the Go programming language 2.4[d] httpd common [d],devel,minimal Apache HTTP Server DL1 idm adtrust,client,common [d],dns,server The Red Hat Enterprise Linux Identity Management system module client[d][e] idm common[d] RHEL IdM long term support client module inkscape 0.92.3[d][e] common[d] Vector-based drawing program using SVG javapackages-runtime 201801[d][e] common[d] Basic runtime utilities to support Java applications javapackages -tools 201801[d][e] common[d] Tools and macros for Java packaging support ue120[d] common [d],core Java Mission Control is a profiling and diagnostics tool for the Hotspot JVM jmo ue120 [d] common[d] LLVM 10.3[d] client,galera,server[d] MariaDB Module 10.5 client,galera,server [d] MariaDB Module 3.5[d] Jova pr ie en nn e p r maven common[d] 3.6[e] client,default,server 1.14[d] common[d] nginx webserver 1.16 common[d] nginx webserver 1.18 common[d] nginx webserver 1.20 common[d] nginx webserver 10[d] common[d],development,minimal,s2i Javascript runtime 12[e] common [d],development,minimal,s2i Javascript runtime 14 common [d],development,minimal,s2i Javascript runtime 7.21 Parfait Module common common[d],devel,minimal PHP scripting language common [d],devel,minimal 7.3 PHP scripting language 7.4 common [d],devel,minimal PHP scripting language 10.6 PKI Core module for PKI 10.6 or later 10.6[e] PKI Dependencies module for PKI 10.6 or later 9.6 client,server [d] PostgreSQL server and clientmodule 10[d] client,server [d] PostgreSQL server and client module 12 client,server [d] PostgreSQL server and client module 13 client,server [d PostgreSQL server and client module 2.7[d][e] common[d] Python programming language,version 2.7 3.9[d] build,common [d] Python programming language, version 3.9 5[d] common[d] Redis persistent key-value database redis common[d] Redis persistent key-value database 6 ruby 2.5[d][e] common [d] An interpreter of object-oriented scripting language ruby 2.6 common[d] An interpreter of object-oriented scripting language 2.7 An interpreter of object-oriented scripting language common[d] rust-toolset ue120[d] common[d] Rust)

图7.1列出所有可用模块化

执行dnf module provides php-common命令,查看有php-common包的模块。

图7.2查询提供php-common包的模块

执行dnf module list php命令,列举php模块的所有流。

图7.3列出所有php模块流

执行dnf module info php命令,查看php模块的详细信息。

图7.4查看php模块详细信息

执行dnf module info --profile php命令,查看php模块的profile信息。

图7.5查看php模块的profile信息

执行dnf module enable php:7.2命令,使能php模块7.2流。

图7.6使用php:7.2模块流

执行dnf module repoquery php命令,查看php模块已启用流中的包。

图7.7查看php模块已启用流中的包

执行dnf module list --enabled php命令,查看php模块中已启用的流。

图7.8查看php模块已启用的流

执行dnf module install php:7.2/devel命令,安装php模块、流为7.2的devel档案中包含的所有包。

图7.9安装php:7.2/devel中所有的包

执行dnf module list --installed php命令,查看php模块中已安装的流。

图7.10查看php模块已安装的流

执行dnf module reset php命令,使php模块恢复默认状态。

图7.11恢复php模块的默认状态

执行dnf module remove php命令,移除php模块中的包。

图7.12卸载已安装的php模块中的包

执行dnf module remove --all php命令,移除php模块中的包。

图7.13卸载已安装的php模块中的所有包

执行dnf module disable php命令,禁用php模块中的所有流。

图7.14禁用php模块中的所有流