How to install software in RHEL 8

Red Hat Enterprise Linux version 8.0 has been out for some time and is available for testing purposes on RedHat’s website. All you need to do to get it is create an account if you don’t already have one, download the ISO and install it using your credentials. If you have previously worked with the 7.x branch of Red Hat Enterprise Linux or CentOS the installation process will be familiar to you since not much has changed.

But what you have to keep in mind is that this is a commercial Linux distribution and thus you will get access not only to technical support but also commercial software, unavailable otherwise in fully open-source Linux distributions based on Red Hat Linux.

In this tutorial you will learn:

  • How to subscribe to software channels in Red Hat Enterprise Linux 8
  • How to install software in Red Hat Enterprise Linux 8 with the help of Red Hat repositories
  • How to install standalone RPM packages
  • How to compile software for RHEL yourself
  • How to convert between DEB packages to RPM

Applications categories on Red Hat Enterprise Linux 8 Software Center

Applications categories on Red Hat Enterprise Linux 8 Software Center

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Red Hat Enterprise Linux 8
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user


Register your RHEL 8

After you are done with the installation part and opted for the GNOME desktop environment you’ll probably want to get access to your favourite software – the applications you grew accustomed to and maybe prefer to use instead of the default ones. To access the Red Hat Enterprise Linux software repositories you will first need to register your system. One can do this via GNOME Terminal with

# subscription-manager register --username  --password 

where and are substituted with the login credentials you have created on the RedHat portal. And yes – these will be entered in CLI in plaintext but you only need to do this once. Use

# subscription-manager refresh

to refresh the information on your machine. And now that your system is registered you can add a subscription that matches your credentials with

# subscription-manager attach --auto

Optionally you can save some time and enter all of the above in a one-liner, like this:

# subscription-manager register --username  --password  --auto-attach

To list all available subscription pools use

# subscription-manager list --available

and then pick the one you wish to use by specifying its pool ID:

# subscription-manager attach --pool=8a85f99a6901df4001690732f1015693

Or you can just add everything to the repo list and enable every available repository by launching

# subscription-manager repos --enable=*


To update the repository list and get access to the latest software use either dnf update or yum update. If you want to use a GUI just launch Software and enable repositories from the Software Repositories menu with the help of your mouse. Worth mentioning is that with this new release Red Hat Enterprise Linux now uses two main repositories, a different model from previous releases.

One called “BaseOS” with anything concerning OS update and one called “AppStream”. This means that everything you used to find in the “optional” or “extras” repositories went inside AppStream in RHEL 8.0.

Software Repositories on Red Hat Enterprise Linux 8

Software Repositories on Red Hat Enterprise Linux 8


The easy way to install applications in RHEL 8.0 is to use the Software GUI. Once you enabled software repositories you can just browse applications and click Install to have them delivered to you.

Another way to install application is by using the Software GUI. Just point and click.

Another way to install application is by using the Software GUI. Just point and click.

Some software packages you will be able to install when prompted, such as the GStreamer codecs needed to play video files and streams in the Videos application (also known as “Totem”). The rest will need to be installed via command line or by using the “Software” application.



Trying to play a video file prompts you to automatically install the necessary codecs

Trying to play a video file prompts you to automatically install the necessary codecs


Software installation – the CLI way

To search for a package using the CLI one can use dnf search where ” could be – for example – python or Python. Then you can look for the package you want to install and use

# dnf install package_name

to do so. If you want to reinstall a package use

# dnf reinstall package_name

Alternatively, if you are old-fashioned, you can use yum instead of dnf with similar results. You can also bulk install entire package suites with dnf by using groupinstall. Use

# dnf grouplist

in GNOME Terminal to get a list of all the installed and available groups such as "Development Tools" or "Server". To install an entire existing group with all its packages and corresponding dependencies without resorting to individually installing each one you can do a

# dnf groupinstall "Smart Card Support"

This will install everything you need to do Smart Card hardware management.

Installing Rhythmbox using dnf

Installing Rhythmbox using dnf

If you did a minimal install of Red Hat Enterprise Linux 8.0 then you can turn it into the Workstation version with



# dnf groupinstall "Workstation"

and get the GNOME desktop environment with all its default tools and utilities that get shipped with RHEL 8. All in one shot.

With the help of dnf you can list and install software groups like RPM Development Tools or the Network Servers packages collection

With the help of dnf you can list and install software groups like RPM Development Tools or the Network Servers packages collection


Manual package installation and creation

Since RHEL 8 is fairly new you will need to get most of the software from somewhere else, since the repositories that come with RHEL 8.0 are barely populated with useful stuff. For example, you can download htop in RPM format from a Fedora or CentOS repository and install it with

# rpm -ivh package_name.rpm

The i in the attributes list stands for “install” and the v for “verbose”, so you can see the output clearly as the package is being processed. Older packages can be upgraded with

# rpm -Uvh package_name.rpm

While you might find older RPM packages to install in your RHEL 8, if you are a purist and wish to create RPM packages for your CPU architecture and specifically for Red Hat Enterprise Linux 8 you can grab a source RPM and create a RPM yourself. If you wish to install htop from source, download the source package from a Fedora repository like so:

$ wget -c https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/7/SRPMS/htop-0.7-2.fc7.src.rpm

and install it with

# rpm -ivh htop-0.7-2.fc7.src.rpm

This will create a ~/rpmbuild directory containing two other directories: SOURCES and SPECS. The SPECS directory contains the htop.spec file that defines the version number, description of the package and other information you can modify if you wish. You can leave everything as is and now install the rpmbuild package to have something to create a RPM package with:

# dnf install rpmbuild

Now all you have to do is do a

# rpmbuild -ba ~/rpmbuild/SPECS/htop.spec

and the RPM for htop will be created in ~/rpmbuild/RPMS. If you didn’t change the .spec file it will have a name like htop-0.7-2.el8.x86_64.rpm so now you can install it with

# rpm -ivh htop-0.7-2.el8.x86_64.rpm


As with other packages you compile and turn into a RPM, htop has some dependencies. In this case it’s the ncurses-devel package that is already available in the RHEL 8 repositories. You can install it with

# dnf install ncurses-devel

before you get to the compile part.

Double-clicking on the RPM package in a file manager brings up GNOME Software which provides a GUI interface for installing RPM files.

RPM packages can be double-clicked on an installed using Software Center

RPM packages can be double-clicked on an installed using Software Center

Another way to install software in RHEL 8 is to compile software without creating a RPM package. Although Midnight Commander is available in the Red Hat repositories we will use the latest source code as an example. We will need git to download the source code so make sure git is installed:

# dnf install git

Then download the latest stable Midnight Commander source code by using

$ git clone git://github.com/MidnightCommander/mc.git

This will create a mc folder in your current directory. Inside it is an .autogen.sh that is an executable and needs to be run in order to create the configuration files:

$ cd mc && ./autogen.sh

After the process has finished run

$ ./configure && make
# make install

Presuming all dependencies are satisfied, Midnight Commander should compile and install, the binary finally residing in /usr/bin/mc.

Preparing to compile Midnight Commander in RHEL 8.0

Preparing to compile Midnight Commander in RHEL 8.0


DEB and TGZ to RPM conversion

If you are lazy and feeling adventurous you can convert existing software packages destined for Debian or Slackware into RPMs by using Alien. Download alien with wget:

$ wget -c https://sourceforge.net/projects/alien-pkg-convert/files/release/alien_8.95.tar.xz
WARNING
Using converted packages that were destined for other distributions that have a different filesystem hierarchy might break your system or present you with installation errors.

Extract the tar.xz archive with

$ tar xf alien_8.95.tar.xz

You will need Perl to compile the source so install Perl with

# dnf install perl

and after that, while still root, launch this command in alien’s source directory to compile and install it:

# perl Makefile.PL; make; make install

Installation is fast. Now you can convert between TGZ, DEB and RPM packages. If you have a DEB file and want to convert it into a RPM you can use alien like this:

$ alien --to-rpm file.deb

It will generate a corresponding RPM package that you can install afterwards with rpm -ivh.

Conclusion

Software installation in Red Hat Enterprise Linux 8.0 is fairly easy, as long as you don’t have to deal with many dependencies that need manual attention. GNOME Software should do the trick if you are a desktop user. The applications are nicely grouped in categories and the “Add-ons” section has tabs for fonts, codecs, input codecs or GNOME Shell extensions.