If you are using DNF instead of YUM, almost all commands described here will work similarly by replacing
yum with dnf.Registering with Red Hat Subscription Management
Before accessing software repositories, register your system using your Red Hat Developer account credentials:Software Repositories
Software repositories contain packages, configuration files, and libraries. These repositories are usually hosted on the internet, though enterprises can host private repositories on a local network.Viewing Enabled Repositories
To list the repositories currently enabled on your system, run:Repo-baseurl indicates the repository URL, and Repo-filename shows the path to the configuration file on your system.
Enabling Optional Repositories
If the default repositories do not include the package you need, you can enable optional repositories such as the CodeReady Builder RPMs. First, list all available repositories:--enable with --disable:
Adding Custom Repositories
There are times when you need to add external repositories from a specific URL or a local network. First, ensure that the yum-utils package is installed to access the yum-config-manager:Examining a Custom Repository File
Let’s review the Docker repository file that you added. Open the file using an editor such as Vim:-
Repository ID (e.g.,
[docker-ce-stable])
A unique identifier required for the repository. -
Name (
name=Docker CE Stable - $basearch)
A descriptive label displayed in repository lists. -
Base URL (
baseurl=https://download.docker.com/linux/rhel/$releasever/$basearch/stable)
The URL location for the repository. -
Enabled Flag (
enabled=1)
Indicates active status. Changing to 0 disables the repository. -
GPG Check (
gpgcheck=1)
Enables verification of package integrity using GPG signatures. -
GPG Key Location (
gpgkey=https://download.docker.com/linux/rhel/gpg)
Specifies the URL for the GPG key used in verification.
/etc/yum.repos.d/.
Managing Packages with YUM
YUM is a powerful tool for installing, updating, reinstalling, and removing packages from both repositories and local RPM files.Searching for Packages
If you are unsure of a package name, use the search feature. For instance, to search for packages related to web servers:Installing, Reinstalling, and Removing Packages
To install a package like Nginx:Installing Software from an RPM File
YUM can also install packages directly from local RPM files. For example, to install the NoMachine package:-
Download the package:
-
Install the downloaded RPM file:
Managing Package Groups
YUM supports package groups, which allow you to manage related collections of packages together.Listing Available Groups
List all available package groups with:Installing and Removing Group Packages
To install the “Server with GUI” package group:Updating and Upgrading Packages
Keeping your system up to date is crucial. Begin by checking for available package upgrades:After upgrading critical components such as the kernel, it is advisable to reboot your system to ensure all changes take effect properly.
By following the steps in this guide, you can effectively manage software packages and repositories on your RHEL system using YUM. For more detailed information, consider visiting Red Hat’s official documentation. Happy managing!