How to configure yum / dnf repo in RHEL 8 server with screenshots

Here I will show you how to setup yum or dnf in RHEL 8. There are two repositories that have been added one for AppStream and the second is BaseOS. In RHEL 8 both app and base os repositories have been separated from each other.
In RHEL 8 default package manager is dnf and it is symlink with yum.
We will configure yum from local iso but the procedure is the same from FTP server too only need to change baseurl path.

How to configure yum(Yellow Dog Update Modifier) or dnf(Dandified Yum) in RHEL 8

  1. Mount RHEL 8 DVD or iso to OS
  2. Check mounted devices

  # lsblk

           here it is sr0

     4. Mount iso to /mnt or any other directory. We have mounted here on /mnt
        # mount -o loop /dev/sr0 /mnt


   5. Create a rhel8.repo file in yum directory 
       # vi /etc/yum.repos.d/rhel8.repo
  6. Make below entry in file :

[AppStream]
name=Appstream
baseurl=file:///mnt/AppStream/
enable=1
gpgcheck=0
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS/
enable=1
gpgcheck=0
7. Press esc, type-   :wq! enter  to save file 
8. You can replace ftp server link also on baseurl = http://siteaddrss/AppStream . If you are using FTP server.
9. Check it is correctly configured or not 
# yum repolist
#dnf repolist
Now you have configured yum and you can start to install packages from yum/dnf.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top