How to Create Local Yum Repository on RHEL 8
What is yum repository?
YUM repositories are used to hold and manage RPM packages. It supports common Unix packages management clients such as yum and zypper used by popular Unix distributions such as RHEL and CentOS. Artifactory is a fully-featured RPM and YUM repository manager that lets you integrate YUM packaging management into your organization and development flow.
Using the RHEL 8 ISO, we are going to create a local yum repository in this short how-to. The local yum repository will not work as expected as we did in previous RHEL distributions. When trying to install any package, it may throw an error for dependencies. Those looking for how to create one in RHEL 8 might find this useful.
It comes with two repositories, the “BaseOS” and “AppStream” repositories. Here are our two repository configurations.
In the BaseOS repository are packages such as the OS installation packages (Core Packages), the Administrative tools packages, and their dependencies. You can navigate to location //run/media/root/RHEL-8–0–0-BaseOS-x86_64/BaseOS to have a look.
AppStream Repository will have all remaining packages like vim, PostgreSQL, MariaDB, Maven, Bind, LibreOffice, and all other application and OS-related dependencies under /run/media/root/RHEL-8–0–0-BaseOS-x86_64/AppStream.
RHEL 8 Related Articles may be of interest to you.
Now we will understand yum confirmation through few steps.
Step 1. Create YUM Repository configuration file
In /etc/yum.repos.d/, create a YUM Repository configuration file with a .repo extension using the console text editor. Run the following command from the console to create a new file with the “vi editor”:
cd /etc/yum.repos.d
vi my_yum.repo
Output:-
Step 2. Open the file and find the location
Firstly, go to the given location in the RHEL 8 Linux CD or if you are using any virtual software then attach the ISO or image file to the virtual machine and go to the location or folder given below.
Open appstream directory
Now open the terminal in the same folder where your package and repodata are present, and run the command below.
Open the current working directory and copy the URL.
Step 3:-
Type in the code and save it. Before you can proceed, you must replace the BiOS CD-ROM name with RHEL-8–0–0-BaseOs-x86_64. The rest of the procedure is the same as before.
Practical we just did with Appstream. The same exercise we do with base OS and copy the URL.
We went to the path of Besos and opened that location on the terminal
Open the current working directory and copy the URL.
RedHat Package Manager uses the Yellowdog Updater Modifier. This PMT is really called Yellowdog Updater Modifier (YUM). A long time ago, YUM was used. In Redhat 8 Linux, however, there is a new dnf command, which stands for Dandified YUM. Both commands are fully functional, but dnf is faster due to the fact that some bugs have been fixed.