KB646014: Configure Filesystem-based Software Repository Location for Red Hat Enterprise 8

From LI AO's Wiki (Miraheze)


Introduction[edit | edit source]

This article introduces solution for configuring file-system based software repository to be used by the package manager YUM on systems running Red Hat Enterprise Linux 8 or an equivalent. From a default installation Web based repositories are used by the OS by downloading packages using HTTP.

Symptoms[edit | edit source]

Web-based repositories are used by the OS which may incur Internet data charges. A filesystem-based repository location needs to be specified instead to prevent additional connection charges from the Internet service provider.

Solution[edit | edit source]

Make sure to disable unused Web-based software repositories by changing "enabled=1" to "enabled=0" under every item in every file under the default YUM repositories configuration files, which usually comes at /etc/yum.repos.d/ . For example, to disable unused repository which downloads the manifest list from AlmaLinux's server, ensure configurations like this to be set up:

[BaseOS]
name=AlmaLinux - BaseOS
baseurl=https://nonexistenthosts.liao.media/repo/$releasever
enabled=0
gpgkey=https://nonexistenthosts.liao.media/GPG-RHELRELEASE-1
gpgcheck=1

Because YUM automatically searches for every files under this directory and checks for every configuration entries, configuration of unused repositories must be turned off by purposing the option as shown in line 4 above. Then, add local filesystem-based repositories by specifying a file:/// URI:

[BaseOS]
name=AlmaLinux - BaseOS
baseurl=file:///media/CDROM/RHELRELEASE-DVD-Everything-8.9/BaseOS
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ALMALINUX
gpgcheck=1

Make sure the repodata folder is included under the path specified. This is essential for the software repository to be fetched.

By default path to GPG keys which authenticate the software publisher is already specified with a file-based URI, making sure the installation source can be independently verify the authenticity of the provided software from the repository. If not, please specify the path to where the GPG keys are located which contains the keychain that has the signing certificate included, or, disable the "gpgcheck" flag to disable key checking.