引言

从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. String--Date互转

    相关类:DateFormat:抽象类DateFormat可以进行日期和字符串的格式化和解析,使用子类SimpleDateFormat实现. 1.Date --> String(格式化) publ ...

  2. Spring框架中有哪些不同类型的事件?

      Spring 提供了以下5种标准的事件: (1)上下文更新事件(ContextRefreshedEvent):在调用ConfigurableApplicationContext 接口中的refre ...

  3. jvm-learning-运行时数据区-整体

    在jdk8之后之前的方法区有叫做元数据. 每个JVM只有一个Runtime实例,即为运行时环境,相当于内存结构种的运行时数据区 线程 线程是一个程序里的运行单元,JVM允许一个应用有多个线程并行的执行 ...

  4. SpringBoot Jpa 双数据源mysql + oracle + liquibase+参考源码

    一.yml文件配置 spring: # 数据库配置 datasource: primary: jdbc-url: jdbc:mysql://localhost:3306/mes-dev?useUnic ...

  5. 集合迭代器Iterator

    迭代器模式:就是提供一种方法对一个容器对象中的各个元素进行访问,而又不暴露该对象容器的内部细节. 什么是迭代器Iterator? Java集合框架的集合类,我们有时候称之为容器.容器的种类有很多种,比 ...

  6. 转载:STL四种智能指针

    转载至:https://blog.csdn.net/K346K346/article/details/81478223 STL一共给我们提供了四种智能指针: auto_ptr.unique_ptr.s ...

  7. Djnago中缓存配置(redis配置案例)

    Django中提供了6种缓存方式: 开发调试 内存 文件 数据库 Memcache缓存(python-memcached模块) Memcache缓存(pylibmc模块) 配置文件 # 内存 CACH ...

  8. mybatis-03-一对多关系映射(附源码)

    sb_mybatis /* Navicat MySQL Data Transfer Source Server : 阿里云 Source Server Version : 50724 Source H ...

  9. AutoValue —— Generated immutable value classes

    本文参考 在<Effective Java>第三版第十条"Obey the general contract when overriding equals"中提到goo ...

  10. Vue2的右键弹出菜单(vue-contextmenu)

    给大家推荐一个基于Vue2的右键弹出菜单插件,支持单一SPA页面以及可以在循环绑定中使用. 项目地址为:https://github.com/chIIC/vue-...demo1: 父组件绑定右键事件 ...