Categories
Red Hat Enterprise Linux

Red Hat Enterprise Linux 8 – Repositories, Ansible, and Flatpak

Out of the box, assuming you’ve done a graphical installation (or installed the graphical bits afterwards) you should be left with a Red Hat desktop that uses Gnome, and is relatively well featured out of the box.

You’ll have software like Gnome Boxes, Terminal, Software, Activity Monitor, Firefox… the typical sort of things you expect any desktop environment to ship with by default.

Now, we have some problems.

The first problem is the fact Red Hat doesn’t, and hasn’t ever, shipped with that many packages in its default repositories. The OS is very targeted towards server work and that means you’re a bit limited in overall choice. For example, it nets me frowns from colleagues, but I’ve often found ‘htop’ to be a much more pleasant experience than vanilla ‘top’ and it’s generally in the default repositories for most distributions, not so with Red Hat.

What about EPEL I hear you shout (or type angrily,) well EPEL isn’t ready yet, and it generally lags a bit behind Red Hat releases, because they’ve got to make sure all the software works reliably and isn’t going to cause problems with the latest version of the OS. At the time of writing EPEL is available for for CentOS/RHEL 7, and not 8.

This is not the end of the world, as we shall see.

Repositories

Once you’ve registered your machine:

# subscription-manager register
# subscription-manager attach

You should have access to the various Red Hat repositories, you can view enabled repositories with the following:

# yum repolist
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:15 ago on Sun 09 Jun 2019 15:31:36 BST.
repo id                                 repo name                         status
rhel-8-for-x86_64-appstream-rpms        Red Hat Enterprise Linux 8 for x8 5,086
rhel-8-for-x86_64-baseos-rpms           Red Hat Enterprise Linux 8 for x8 1,963
rhel-8-for-x86_64-highavailability-rpms Red Hat Enterprise Linux 8 for x8    67

This isn’t to say that you absolutely have to stick to the Red Hat ones, as you’re more than welcome to add any compatible (and sensible) repository that you want to, but these are available for you to use from Red Hat.

If you wanted to know what others were available, you would use the following command (note than I’ve truncated it somewhat as the list can be very long:)

# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   ansible-2-for-rhel-8-x86_64-debug-rpms
Repo Name: Red Hat Ansible Engine 2 for RHEL 8 x86_64 (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/layered/rhel8/x86_64/ansible/2/debug
Enabled:   0

Repo ID:   rhel-8-for-x86_64-sap-solutions-debug-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - SAP Solutions (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/sap-solutions/debug
Enabled:   0
...

You will also note that aside from the regular repositories, we have debug repositories available, which I don’t care about for now.

Ansible

I use Ansible a lot, it’s a great tool for automating deployments and it’s so simple that even someone like me can use it!

With that in mind, I very nearly broke my very first rule and used Pip to install the latest version of Ansible, before I noticed that Red Hat actually had a subscription-repo available, apparently with Ansible 2.8.

Repo ID:   ansible-2.8-for-rhel-8-x86_64-rpms
Repo Name: Red Hat Ansible Engine 2.8 for RHEL 8 x86_64 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/layered/rhel8/x86_64/ansible/2.8/os
Enabled:   0

So I enabled this, using the following command:

# subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms

And… it turned out the repository wasn’t ready yet, and was actually empty.

Fast-forward a few days, and the repository was now populated, meaning installing Ansible 2.8 was a simple case of running a YUM install.

# yum install ansible

It’s worth noting that as of RHEL 8, you’re actually using ‘dnf’ when you invoke the ‘yum’ command, but it’s also worth noting that DNF stands for Did Not Finish in racing, and given my track record with running marathons, it’s not something I enjoy actively invoking.

The end result of this, is I can use a natively installed (and very recent) version of Ansible on my workstation:

$ ansible --version
ansible 2.8.0
  config file = /etc/ansible/ansible.cfg
...

Flatpak

Now, as I said in the opening post on using RHEL as a workstation, there are some other pieces of software that you just can’t get away from when it comes to modern system administration and DevOps. Slack is one such program.

I’m not actually a fan of Slack, I find it tends to make people sloppy when it comes to going through appropriate channels for work, and I think self-hosted systems are better for workplace environments, but that aside, everybody seems to use it these days.

Slack isn’t available in the default repositories, or this would be a short section, but it is available as a package from Flathub, and Flatpak can be installed from YUM on RHEL 8, giving us access to a much wider variety of programs than we would otherwise have access to.

$ sudo yum install flatpak
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Once Flatpak and Flathub are in place, you have two options. You can either search for software from the command line:

$ flatpak search slack
Application ID         Version Branch Remotes Description                   
com.slack.Slack        3.4.2   stable flathub Chat with your team 
...

Or you can now use Gnome Software:

The Software interface is extremely clean.

You can also search for software on the Flathub website, if so inclined.

Software that you, as a Developer or Sysadmin, might find useful include:

  • Slack
  • Visual Studio Code
  • Remmina
  • Skype
  • Builder
  • Atom
  • GitKraken
  • Godot
  • GNU Emacs
  • Sublime Text
  • FileZilla
  • Dropbox

And so on, and so on. All of these are available in the form of Flatpak installations, meaning you don’t have to worry about things like dependencies on your machine.

As with anything, make sure you trust the source of your software, even when it’s proprietary and you can’t even look at the code.

Honestly I think the inclusion of official Flatpak support is one of the best things Red Hat has done with RHEL 8, as it means you get access to a much wider ecosystem than the curated one they offer, without hacking anything to work on your machine.


Adam – Terrafoundry Director and Consultant