引言

从RHEL8/CentOS8开始,dnf取代yum作为rpm 包管理工具。与之而来的还有模块(module)这个东西。 有了它们的加持,让在同一个OS上安装不同版本的软件或者开发语言的工作比之前容易多了。

简介

Modules are special package groups usually representing an application, a language runtime, or a set of tools. They are available in one or multiple streams which usually represent a major version of a piece of software, giving you an option to choose what versions of packages you want to consume.

To simplify installation, modules usually define one or more installation profiles that represent a specific use case. For example a server or a client profile in a database module.

也就是说:

一个软件可以有多个版本,每个版本对应一个stream. 在每个stream内部,又分为proile对应到安装场景(比如开发, server, client)。

实际dnf使用中的要点

如果module有多个stream(版本),会有一个是默认的, 在dnf命令输出里面在stream name后用[d]表示

如果某个stream有多个profiles, 会有一个默认的,在dnf命令输出里面在profile name后用[d]表示

Module install

语法

    $ dnf module install NAME
$ dnf module install NAME:STREAM
$ dnf module install NAME/PROFILE
$ dnf module install NAME:STREAM/PROFILE

下面以nginx举例

$ sudo dnf module list nginx
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
nginx 1.14 [d] common [d] nginx webserver
nginx 1.16 common [d] nginx webserver
nginx 1.18 common [d] nginx webserver
nginx 1.20 common [d] nginx webserver Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

解读output:

nginx module 有4个stream(对应4个版本),默认安装的是1.14,1.14这个stream只有一个profile “common”, 它也是默认安装的profile

例子: 查看已经安装的module

$ dnf module list --installed
Name Stream Profiles Summary
nodejs 14 [e] common [d] [i], development, minimal, s2i Javascript runtime
python39 3.9 [d][e] build, common [d] [i] Python programming language, version 3.9 Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

dnf module list --installed 显示已经安装的module

查看输出 nodejs这一行表示:

14 [e]: 表示14这个版本(stream)已经启用了,用[e]表示. 这里[e]就肯定说明已经安装了

common [d] [i], development, minimal, s2i : 共4个profiles: common, devleopment, mininal, s2i。 其中common 是默认的Profile,用[d]表示,而且它已经安装在本机了,用[i]表示

查看输出 python39这一行表示:

3.9 [d] [3]: 3.9这个版本(stream)是这个module的缺省版本,用[d]表示;而且是已经启用了,用[e]表示。 这里[e]就肯定说明已经安装了

Refer

https://docs.fedoraproject.org/en-US/modularity/using-modules/

Infrastructure 知识: dnf对module的处理的更多相关文章

  1. ruby 基础知识 - Class 与 Module

    原文 1. 因為 Ruby 並沒有「屬性」(property/attribute)這樣的設計,要取用實體變數,需要另外定義的方法才行: class Cat def initialize(name, g ...

  2. ruby基础知识之 class&module

    以下分别介绍了class方法和module方法,还有最简单的def方法. 其中module和class的区别下面会说,这里首先声明,def定义的方法,需要定义对象后才能调用,而class和module ...

  3. Infrastructure 知识: DNS 命令: dig, host

    dig 基本用法: dig @server name type 或者用-t type来指定(更常见) dig @server -t type name 例子详解 # 最简单的使用 $ dig www. ...

  4. Oracle ODI系列之一(ODI知识模块)

    Oracle ODI系列之一(ODI知识模块)     ODI简介 ODI(Oracle Data Integrator)前身是Sunopsis Active Integration Platform ...

  5. [转] 添加新的系统调用 _syscall0(int, mysyscall)

    实验目的阅读 Linux 内核源代码,通过添加一个简单的系统调用实验,进一步理解Linux操作系统处理系统调用的统一流程.通过用kernel module的方法来实现一个系统调用实验,进一步理解Lin ...

  6. Dragger代码实现

    转自:http://www.apkbus.com/blog-705730-60436.html 在工程中引入Dagger 如果想使用Dagger的话,需要添加两个函数库: dependencies { ...

  7. Ansible安装部署以及常用模块详解

    一.  Ansible 介绍Ansible是一个配置管理系统configuration management system, python 语言是运维人员必须会的语言, ansible 是一个基于py ...

  8. ansible环境部署及常用模块总结 - 运维笔记

    一.  Ansible 介绍Ansible是一个配置管理系统configuration management system, python 语言是运维人员必须会的语言, ansible 是一个基于py ...

  9. Creating Modules

    转自官方文档,主要说明如何创建模块 https://www.terraform.io/docs/modules/index.html A module is a container for multi ...

随机推荐

  1. Oracle数据常用的备份与恢复?

    Oracle的备份与恢复有三种标准的模式,大致分为两大类,备份恢复(物理上的)以及导入导出(逻辑上的),而备份恢复又可以根据数据库的工作模式分为非归档模式(Nonarchivelog-style)和归 ...

  2. 介绍Collection框架的结构?

    随意发挥题,天南海北谁便谈,只要让别觉得你知识渊博,理解透彻即可.

  3. SpringBoot starter 作用在什么地方?

    依赖管理是所有项目中至关重要的一部分.当一个项目变得相当复杂,管理依赖会成为一个噩梦,因为当中涉及太多 artifacts 了. 这时候 SpringBoot starter 就派上用处了.每一个 s ...

  4. Files的常用方法都有哪些?

    Files. exists():检测文件路径是否存在.Files. createFile():创建文件.Files. createDirectory():创建文件夹.Files. delete():删 ...

  5. 一个Spring的应用看起来象什么?

    一个定义了一些功能的接口. 这实现包括属性,它的Setter , getter 方法和函数等. Spring AOP. Spring 的XML 配置文件. 使用以上功能的客户端程序.

  6. Oracle入门基础(八)一一数据处理

    SQL> SQL的类型 SQL> 1.DML(Data Manipulation Language 数据操作语言): select insert update delete SQL> ...

  7. Vue部署到云服务器时,访问Nginx代理出现We're sorry but books doesn't work properly without JavaScript enabled. Please enable it to continue.

    出现这个的原因,我这边的是Nginx的问题,因为没有匹配到静态文件的原因 第一个location是始终将访问的url请求定向到 index.html这个主页面 第二个location块是将index. ...

  8. jQuery--筛选【串联函数】

    串联函数简介 A.add(B) 将A和B组合成一个对象 A.children().andSelf() 将之前的对象添加到操作集合中 A.children().children().end() 回到最近 ...

  9. synchronized 的作用?

    在 Java 中,synchronized 关键字是用来控制线程同步的,就是在多线程的环境 下,控制 synchronized 代码段不被多个线程同时执行. synchronized 既可以加在一段代 ...

  10. SQL Server中如何让SQL语句对字符串大小写敏感

    在SQL Server中默认对大小写是不敏感的,例如fname='peter'和fname='PETER'结果是一样的.但有时候用户会要求区分大小写,如验证密码等.这种情况下的处理办法就是在字段后加上 ...