Difference between revisions of "Understanding RHEL Software Installation and Management"
Line 155: | Line 155: | ||
The following output, for example, lists information about the PHP modules available for installation: | The following output, for example, lists information about the PHP modules available for installation: | ||
− | + | <htmlet>rhel8</htmlet> | |
<pre> | <pre> | ||
# dnf module list php | # dnf module list php |
Latest revision as of 16:04, 17 June 2019
Previous | Table of Contents | Next |
Managing RHEL 8 Users and Groups | Configuring RHEL 8 systemd Units |
You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book. Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($9.99) or Print ($36.99) format Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages |
It is highly unlikely that a newly installed RHEL 8 system will contain all of the software packages to perform the tasks for which it is intended. Even once all the required software has been installed, it is almost certain that newer versions of many of those packages will be released during the lifespan of the system. In some cases, you will need to ensure that these latest package releases are installed on the system to ensure that any bugs are fixed. In other cases, however, an older version of a particular software package may need to be kept on the system for compatibility with other software.
This chapter introduces the basic concepts of software management on RHEL 8, explains how these issues are addressed, introduces the concepts of repositories, software packages and the Red Hat AppStream) and explores how to list, install and remove the software packages that make up a functioning RHEL 8 system.
Repositories
Linux is essentially comprised of a set of base packages that provide the core functionality of the operating system together with a range of other packages and modules that add functionality and features on top of the base operating system.
When RHEL 8 is first installed, a number of different packages will be installed depending on the software options selected during the installation phase. Once the system is up and running, however, additional software can be installed as needed. Typically, all software that is part of RHEL 8 (in other words software that is not provided by a third party vendor) is downloaded and installed on the system using the dnf command. As we have seen in earlier chapters, this typically consists of a command similar to the following being issued at the command prompt:
# dnf install httpd
When such a command is issued, the requested software is downloaded from a remote repository and installed on the local system. By default, RHEL 8 is configured to download software from two repositories named repositories the system is currently configured to use when downloading software:
# dnf repolist Updating Subscription Management repositories. Updating Subscription Management repo id repo name status rhel-8-for-x86_64-appstream-rpms Red Hat Enterprise Linux 8 for x86_64 - 4,594 rhel-8-for-x86_64-baseos-rpms Red Hat Enterprise Linux 8 for x86_64 - 1,686 google-chrome google-chrome 3
The above example shows that repositories for both AppStream and BaseOS are enabled on the system. Note also that repositories may also be added for third party software, as is the case for the Google Chrome repository listed above.
Additional repositories may be added to the system placing entries in the /etc/dnf/yum.repos.d/ directory. Alternatively, the repository may be added using the dnf config-manager tool, passing the URL of the .repo file for the repository as a command-line argument:
# dnf config-manager --add-repo https://url/of/repo/file
The BaseOS Repository
The BaseOS repository contains the packages that make up the core functionality of the operating system. These software elements are downloaded in the form of :
# rpm -qa | more qemu-kvm-block-rbd-2.12.0-41.el8+2104+3e32e6f8.x86_64 kyotocabinet-libs-1.2.76-17.el8.x86_64 cyrus-sasl-scram-2.1.27-0.3rc7.el8.x86_64 curl-7.61.1-5.el8.x86_64 . .
A list of packages available for installation from the BaseOS repository is available by running the dnf command as follows:
# dnf list
To obtain a list of packages that match a search string use dnf as follows:
# dnf search "search string"
It is also possible to identify which package contains a specific file:
# dnf provides filename
For example:
# dnf provides /etc/httpd/conf/httpd.conf Updating Subscription Management repositories. httpd-2.4.35-6.el8+2089+57a79027.x86_64 : Apache HTTP Server Repo : @System Matched from: Filename : /etc/httpd/conf/httpd.conf httpd-2.4.35-6.el8+2089+57a79027.x86_64 : Apache HTTP Server Repo : rhel-8-for-x86_64-appstream-beta-rpms Matched from: Filename : /etc/httpd/conf/httpd.conf
To install a package, run the following command:
# dnf install packagename
Similarly, to delete a package:
# dnf delete packagename
When a newer version of a BaseOS package is made available it will be downloaded and installed when the system is next updated, typically via the dnf command:
# dnf update
Any updated packages will replace the older version currently installed on the system. While this is generally the ideal situation when working with base operating system packages, this is not necessarily the desired behavior when dealing with other packages such as programming environments or development libraries where upgrading to a new version may cause compatibility issues with other packages installed in the system. This issue is addressed by the AppStream repository.
The AppStream Repository
The AppStream repository manages software in terms of packages, modules, streams and profiles. AppStream packages are, once again, RPM packages as outlined in the previous section describing BaseOS. AppStream modules, on the other hand, are groups of packages that belong together or for which dependencies exist (for example the group of packages that would need to be installed together when building a web server). Each module can have multiple streams, where each module stream represents a different version of the software module.
Consider, for example, a RHEL 8 system hosting a web site which depends on version 7.1 of the PHP scripting language. The server still needs to receive any updates to PHP 7.1 to benefit from patches and bug fixes, but is not compatible with the latest version of PHP (version 7.2). Before the introduction of AppStream, it would have been difficult continue receiving version 7.1 updates when newer versions have been released.
To address this issue, the RHEL software management tools can use the AppStream repository to subscribe only to a specific stream for a specific module (in this case the version 7.1 stream of the PHP module).
In addition to streams, modules may also be sub-classed by module profile. Module profiles provide different configurations of packages that make up a module to be installed dependent on the requirements of the system. The nodejs JavaScript runtime environment module, for example, is available for installation using either the development or minimal profiles. On a system where development is taking place using nodejs, the development profile would most likely be used. When the software developed using nodejs is deployed, the minimal system containing just the runtime might be installed instead.
To view the list of modules available for installation use the dnf command as follows:
# dnf module list Updating Subscription Management repositories. Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) Name Stream Profiles Summary 389-ds 1.4 default 389 Directory Server (base) App-cpanminus 1.7044 [d] default [d] Get, unpack, build and install CPAN mo dules DBD-MySQL 4.046 [d] default [d] A MySQL interface for Perl DBD-Pg 3.7 [d] default [d] A PostgreSQL interface for Perl DBD-SQLite 1.58 [d] default [d] SQLite DBI driver DBI 1.641 [d] default [d] A database access API for Perl YAML 1.24 [d] default [d] Perl parser for YAML . . . Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
The first column in the list is the name of the module, the second the stream name (which is typically the version of the module). The letter after the stream name indicates whether the stream is the default (i.e. this is the stream that will be used for installation if no specific stream is referenced) or if it has been enabled for use when performing installations. The third column lists the profiles available for the corresponding package together with an indication of whether the profile is the default, has been installed or is disabled.
The dnf command to list information about a specific module is structured as follows:
# dnf module list modulename
The following output, for example, lists information about the PHP modules available for installation:
You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book. Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($9.99) or Print ($36.99) format Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages |
# dnf module list php . . Name Stream Profiles Summary php 7.1 devel, minimal, default [d] PHP scripting language php 7.2 [d] devel, minimal, default [d] PHP scripting language
Clearly version 7.2 will be installed on the system by default, and the module is available in development, default and minimal profile configurations.
To install a module using the default stream and profile, the dnf command can be used with the following syntax:
# dnf install @modulename
For example:
# dnf install @php
Alternatively, a stream may be specified from which to perform the installation:
# dnf install @modulename:stream
For example:
# dnf install @php:7.1
Finally, a profile may also be declared as follows:
# dnf install @modulename:stream/profile
For example, to install the minimal set of packages for PHP 7.1:
# dnf install @php:7.1/minimal
After executing the above command, the PHP modules will now be listed as follows:
php 7.1 [e] devel, minimal [i], default [d] PHP scripting language php 7.2 [d] devel, minimal, default [d] PHP scripting language
This “[e]” indicator in the stream column tells us that the 7.1 stream has been enabled while the “[i]” in the profile column shows that the module has been installed using the minimal profile.
To enable a stream without installing a module, use dnf as follows:
# dnf module enable modulename
Similarly, a stream may be disabled as follows:
# dnf module disable modulename
To uninstall a module, use the following syntax:
# dnf module remove modulename
Additional information about a module may be identified using the following dnf command:
# dnf module info modulename
To find out which RPM packages make up the different profiles of a specific module and stream combination, use dnf as follows:
# dnf module info --profile modulename:stream
For example:
# dnf module info --profile php:7.1 Updating Subscription Management repositories. Updating Subscription Management repositories. Last metadata expiration check: 1:08:22 ago on Mon 01 Apr 2019 02:43:31 PM EDT. Name : php:7.1:820181025145012:76554e01:x86_64 devel : libzip : php-cli : php-common : php-devel : php-fpm : php-json : php-mbstring : php-pear : php-pecl-zip : php-process : php-xml minimal : php-cli : php-common default : php-cli : php-common : php-fpm : php-json : php-mbstring : php-xml
Finally, to switch from one module stream to another, simply run the installation command referencing the new stream as follows:
# dnf install @modulename:otherstream
This command will download the packages for the new stream and either upgrade or downgrade the existing packages to the specified version. Once this process is complete, resynchronize module packages for the new stream:
# dnf distro-sync
Summary
The RHEL 8 system is comprised of RPM format software packages that are downloaded and installed from the Red Hat BaseOS and AppStream repositories. Addtional repositories can be added to the system for installation packages as needed.
The BaseOS repository contains the packages that implement the base core functionality of the operating system. The AppStream packages, on the other hand, provide additional features and functionality that will be installed selectively depending on the purpose for which the system is being configured. In a complex system of this nature, there can be a significant amount of package interdependency where part of the system may require a specific version of another software package to function correctly. AppStreams allow modules and profiles to be created that contain all of the dependent packages necessary to install a particular feature together at the correct version level. AppStreams also allow installed packages to receive updates to the current version without having to download the next major version, thereby avoiding disrupting the dependencies of other packages.
You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book. Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($9.99) or Print ($36.99) format Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages |
Previous | Table of Contents | Next |
Managing RHEL 8 Users and Groups | Configuring RHEL 8 systemd Units |