Module Installation and Discovery
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.
Consuming content
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.
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.
$ dnf module install NAME $ dnf module install NAME: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 the default stream of MongoDB, run:
$ dnf module install nodejs:8 $ dnf module install mongodb/client
Switching module streams
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 $ dnf module install NAME:STREAM
For example, to switch from Node.js 8 to Node.js 10, run:
$ dnf module reset nodejs $ dnf module install nodejs:10