Chapter 5. Installing RHEL 9 content
Chapter 5. Installing RHEL 9 content In the following sections, learn how to install content in Red Hat Enterprise Linux 9 by using DNF . 5.1. Installing packages If a software is not part of the default installation, you can manually install it. DNF automatically resolves and installs dependencies. Prerequisites Optional: You know the name of the package you want to install . If the package you want to install is provided by a module stream, the respective module stream is enabled. Procedure Use one of the following methods to install packages: To install packages from the repositories, enter: If you install packages on a system that supports multiple architectures, such as i686 and x86_64 , you can specify the architecture of the package by appending it to the package name: To install a package if you only know the path to the file the package provides but not the package name, you can use this path to install the corresponding package: To install a local RPM file, enter: If the package has dependencies, specify the paths to these RPM files as well. Otherwise, DNF downloads the dependencies from the repositories or fails if they are not available in the repositories. Additional resources Installing modular content 5.2. Installing package groups Package groups bundle multiple packages, and you can use package groups to install all packages assigned to a group in a single step. Prerequisites You know the name or ID of the group you want to install . Procedure Install a package group: 5.3. Installing modular content For certain software, Red Hat provides modules. You can use modules to install a specific version (stream) and set of packages (profiles). Procedure List modules that provide the package you want to install: For example, to list the details about the nodejs module, enter: Install a module: If a default profile for a stream is defined, you can omit / <profile> in the command to install this default profile of the stream. Note In Red Hat Enterprise Linux 9, no default module streams are predefined. However, if you specify the stream during the module installation as shown, you do not have to manually enable the stream in advance. For example, to install the default profile ( common ) from stream 18 of the nodejs module, enter: Verification Verify that the correct module stream is enabled ( [e] ) and the required profile was installed ( [i] ): Additional resources Modules Module streams Module profiles 5.4. Defining custom default module streams and profiles Red Hat Enterprise Linux 9 does not define default streams in the AppStream repository. However, you can configure a default module stream and default module profile. In this case, you can omit this information when you install the default stream and profile of a module. Procedure Use the dnf module list <module_name> command to display the available streams and their profiles, for example: In this example, nodejs:18 is not set as the default stream, and the default profile in this stream is common . Create a YAML file in the /etc/dnf/modules.defaults.d/ directory to define the default stream and profile for a module. For example, create the /etc/dnf/modules.defaults.d/nodejs.yaml file with the following content to define 18 as the default stream and minimal as the default profile for the nodejs module: document: modulemd-defaults version: 1 data: module: nodejs stream: "18" profiles: '18': [minimal] Verification Use the dnf module list <module_name> command to verify the new default stream and profile settings, for example: Additional resources Modules Module streams Module profiles 5.5. Additional resources Commands for installing content in RHEL 9
dnf install <package_name_1> <package_name_2> dnf install <package_name> . <architecture> dnf install <path_to_file> dnf install <path_to_RPM_file> dnf group install <group_name_or_ID> dnf module list <module_name> dnf module list nodejs Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime nodejs ... common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled dnf module install <module_name> : <stream> / <profile> dnf module install nodejs : 18 ===================================================================================================== Package Architecture Version Repository Size ===================================================================================================== Installing group/module packages: nodejs x86_64 ... rhel-9-for-x86_64-appstream-rpms 12 M npm x86_64 ... rhel-9-for-x86_64-appstream-rpms 2.5 M Installing weak dependencies: nodejs-docs noarch .. rhel-9-for-x86_64-appstream-rpms 7.6 M nodejs-full-i18n x86_64 .. rhel-9-for-x86_64-appstream-rpms 8.4 M Installing module profiles: nodejs/common Enabling module streams: nodejs 18 dnf module list nodejs Updating Subscription Management repositories. Last metadata expiration check: 0:33:24 ago on Mon 24 Jul 2023 04:59:01 PM CEST. Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) Name Stream Profiles Summary nodejs 18 [e] common [d] [i] , development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled dnf module list nodejs Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime document: modulemd-defaults version: 1 data: module: nodejs stream: "18" profiles: '18': [minimal] dnf module list nodejs Name Stream Profiles Summary nodejs 18 [d] common, development, minimal [d], s2i Javascript runtime