Gregg's MOTD

Tips & Tricks that I've Encountered Over the Years...

Red Hat Subscription Service

July 04, 2023 — Gregg Szumowski

Once you have installed RHEL 9, register your RHEL subscription by running the following command on the terminal. The username and password are the login details to your Red Hat account.

$ sudo subscription-manager register --username=username --password=password

To confirm that the system is registered to Red Hat Subscription Management (RHSM), run the command:

$ sudo subscription-manager list --installed

Then refresh and subscribe:

$ sudo subscription-manager refresh
$ sudo subscription-manager attach --auto

Or, list the subscriptions that are available:

$ subscription-manager list --available --all
$ subscription-manager attach --pool=<POOL_ID>

Unregistering a system:

$ subscription-manager remove --all
$ subscription-manager unregister
$ subscription-manager clean

Tags: cli, rhel, motd

Speed Up DNF Package Manager

July 03, 2023 — Gregg Szumowski

You can increase the download speed for installing packages using DNF by updating the maximum number of simultaneous package downloads.

Start by editing the /etc/dnf/dnf.conf file:

$ sudo nano /etc/dnf/dnf.conf

Add the following line to enable DNF parallel downloads:

max_parallel_downloads=10

Another option is to select the fastest mirror from the Fedora public mirrors by adding the following line:

fastestmirror=True

Tags: cli, dnf, fedora, rhel, package-managers, motd

Red Hat Subscripion Manager - Registering

June 27, 2023 — Gregg Szumowski

Registering your RHEL instance with Red Hat is straightforward assuming that you already have an account:

# subscription-manager register --username <your-rh-user> --password <password>

List the available repos or just go with a default:

# subscription-manager list --available
# subscription-manager attach --auto

Then you can do your update:

# yum update

Tags: cli, rhel, motd

RHEL QCOW Image Password

June 26, 2023 — Gregg Szumowski

Did you know that although you can install RHEL from an ISO, you can also download a QCOW2 image from Red Hat. However, when you try to start it up under virt-manager you’ll see that it boots to a root prompt and you don’t know what the password is. This can be fixed by running the following from the host’s terminal:

# virt-customize -a <qcow2-image-file-name> --root-password password:<password>

Tags: cli, rhel, qcow, motd

How to List Installed Packages in Fedora, RHEL, CentOS

June 24, 2023 — Gregg Szumowski

Listing installed packages with YUM:

$ sudo yum list installed

To display details about a package:

$ yum info nginx

You can cat all installed packages to a file, copy the file to another machine and duplicate the system:

$ sudo yum list installed > installed-packages.txt
$ sudo yum -y install $(cat installed-packages.txt)

List installed packages with RPM:

$ sudo rpm -qa

List them by installation date:

$ sudo rpm -qa --last

Display information about a package:

$ rpm -qi nginx

Tags: cli, rpm, yum, rhel, fedora, motd