From 87224d1c91447122a38649fc74ef32391ddda349 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Mar 07 2019 11:45:10 +0000 Subject: [PATCH 1/2] rewrite 'using modules' --- diff --git a/modules/ROOT/pages/using-modules.adoc b/modules/ROOT/pages/using-modules.adoc index ec72357..9a0fe4e 100644 --- a/modules/ROOT/pages/using-modules.adoc +++ b/modules/ROOT/pages/using-modules.adoc @@ -1,62 +1,75 @@ = Using Modules in Fedora -++++ - -++++ +Modularity is a mechanism of making multiple versions of software available to your system. -From the user perspective, modules are like release-independent package groups on independent life cycles, providing alternative streams of content to Fedora. +**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. -== Enable modular repositories +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. -If you are running the Fedora Server Edition, the Modular Repository should already be enabled. -However, if you are using a container or a different Edition, you need to: +And because having too many choices might be overwhelming, Fedora ships with a set of module **defaults** — so you only need to make choices when desired. - # dnf install fedora-repos-modular +Finally, because big changes are not always welcome, Modularity has been built in a way it can be basically invisible to the user. The usual installation commands continue to work — so packages can be installed the same way as before regardles of them being modularized or not. -== Supported / Unsupported Package Managers +== Discovering content -* Supported -** dnf -** dnfdragora -* Unsupported (if unlisted, assume unsupported) -** microdnf -** PackageKit -** Gnome Software -** Apper -** Cockpit +=== Listing packages -Using an unsupported Package Manager for *any* reason with modules enabled has serious potential to break things. -People are working on the above list of Unsupported package managers primarily by including module support in libdnf. -If you are interested in adding module support to a different package manager, please contact the https://github.com/rpm-software-management/dnf[dnf team]. +Packages available to the system can be discovered by the usual commands such as `dnf search NAME`, `dnf list NAME`, or by using the `dnf repoquery QUERY` command for more complex queries. However, it is important to note that those commands will, apart from traditional packages, only list modular packages coming from a _default_ or an _enabled_ module stream. -== List available modules +Note: Searching for packages in all streams can be done using an unofficial tool available on [github/asamalik/modular-repoquery](https://github.com/asamalik/modular-repoquery). -To list all available modules and their streams, run the following command: +=== Listing modules + +To list modules available to your system, and to see what streams are _default_ or have been _enabled_, use the following command: $ dnf module list -== Install a module +== Consuming content + +=== Installing ackages + +Packages can be installed the usual way by running the `dnf install NAME` command. Any traditional package, or a modular package coming from a _default_ or an _enabled_ module can be installed this way. + +Packages from other module streams can be consumed by either _enabling a module_ stream and then installing individual packages, or by _installing a module_ directly. + +=== Enabling modules + +To **enable a module stream** and make its packages available for installation, run the following command: + + $ dnf module enable NAME:STREAM + +For example, to make Node.js 8 packages available for installation, run: + + $ dnf module enable nodejs:8 + +Packages from enabled module streams can be then installed by the `dnf install NAME` command. + +=== Installing modules + +To install a module, use one of the following commands. Not specifying a _stream_ or a _profile_ causes DNF to choose the _default_. However, not every module has a _default stream_ or _default profile_. -To install a module, use the `name:stream/profile` syntax, for example: + $ dnf module install NAME + $ dnf module install NAME:STREAM + $ dnf module install NAME/PROFILE + $ dnf module install NAME:STREAM/PROFILE - $ dnf module install nodejs:6/default +For example, to install the Node.js 8 runtime and the client tooling of MongoDB, run: -Alternatively, you can also enable a module and then install RPM packages directly: + $ dnf module install nodejs:8 + $ dnf module install mongodb/client - $ dnf module enable nodejs:6 - $ dnf install nodejs +=== Switching module streams -== Changing a stream +Switching to a different stream than the one that is installed on a system is a two-step process. First, the current stream needs to be reset causing it not to be enabled anymore — this will however keep its packages installed. Second, a new stream needs to be installed. -To change a stream of a module that has been already installed, use the installation command. For example: + $ dnf module reset NAME + $ dnf module install NAME:STREAM - $ dnf module install nodejs:9/default +For example, to switch from Node.js 8 to Node.js 10, run: -== Module defaults + $ dnf module reset nodejs + $ dnf module install nodejs:10 -We are currently working on _system profiles_ — the defaults for your system. -Thanks to these, you will need to be specific about the module, stream, or profile only when you need to. When implemented, all the following commands will also work: +== Updating the system - $ dnf install nodejs # installs a nodejs RPM package from the default stream - $ dnf module install nodejs # installs the default profile from the default stream - $ dnf module install nodejs:9 # installs the default profile from the 9 stream +Updating a system by running the `dnf update` command causes all packages to be upgraded to their latest version provided by their module stream. Streams are never automatically switched without an explicit user action. \ No newline at end of file From 4b414056facc1f6d37dc78c526c70993986c665d Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Mar 07 2019 13:23:02 +0000 Subject: [PATCH 2/2] few corrections on the 'using modules' page --- diff --git a/modules/ROOT/pages/using-modules.adoc b/modules/ROOT/pages/using-modules.adoc index 9a0fe4e..d0811e7 100644 --- a/modules/ROOT/pages/using-modules.adoc +++ b/modules/ROOT/pages/using-modules.adoc @@ -8,15 +8,13 @@ To simplify installation, modules usually define one or more **installation prof And because having too many choices might be overwhelming, Fedora ships with a set of module **defaults** — so you only need to make choices when desired. -Finally, because big changes are not always welcome, Modularity has been built in a way it can be basically invisible to the user. The usual installation commands continue to work — so packages can be installed the same way as before regardles of them being modularized or not. +Finally, because big changes are not always welcome, Modularity has been built in a way it can be basically invisible to the user. The usual installation commands continue to work — so packages with a default stream can be installed the same way as before regardles of them being modularized or not. == Discovering content === Listing packages -Packages available to the system can be discovered by the usual commands such as `dnf search NAME`, `dnf list NAME`, or by using the `dnf repoquery QUERY` command for more complex queries. However, it is important to note that those commands will, apart from traditional packages, only list modular packages coming from a _default_ or an _enabled_ module stream. - -Note: Searching for packages in all streams can be done using an unofficial tool available on [github/asamalik/modular-repoquery](https://github.com/asamalik/modular-repoquery). +Packages available to the system can be discovered by the usual commands such as `dnf search NAME`, `dnf list NAME`, or by using the `dnf repoquery QUERY` command for more complex queries. However, it is important to note that those commands will, apart from traditional packages, only list modular packages coming from a _default_ or an _enabled_ module stream. === Listing modules @@ -26,7 +24,7 @@ To list modules available to your system, and to see what streams are _default_ == Consuming content -=== Installing ackages +=== Installing packages Packages can be installed the usual way by running the `dnf install NAME` command. Any traditional package, or a modular package coming from a _default_ or an _enabled_ module can be installed this way. @@ -53,13 +51,15 @@ To install a module, use one of the following commands. Not specifying a _stream $ dnf module install NAME/PROFILE $ dnf module install NAME:STREAM/PROFILE -For example, to install the Node.js 8 runtime and the client tooling of MongoDB, run: +For example, to install the Node.js 8 runtime and the client tooling of the default stream of MongoDB, run: $ dnf module install nodejs:8 $ dnf module install mongodb/client === Switching module streams +NOTE: Switching streams is a risky operation that might not be always supported in packages, especially downgrades. + Switching to a different stream than the one that is installed on a system is a two-step process. First, the current stream needs to be reset causing it not to be enabled anymore — this will however keep its packages installed. Second, a new stream needs to be installed. $ dnf module reset NAME @@ -72,4 +72,4 @@ For example, to switch from Node.js 8 to Node.js 10, run: == Updating the system -Updating a system by running the `dnf update` command causes all packages to be upgraded to their latest version provided by their module stream. Streams are never automatically switched without an explicit user action. \ No newline at end of file +Updating a system by running the `dnf update` command causes all packages to be upgraded to their latest version provided by their module stream. \ No newline at end of file