Setup Local Yum Server on RHEL8

  1. Mount the RHEL8 dvd/iso
# mkdir /rhel8For physical dvd,
# mount /dev/sr0 /rhel8
For ISO,
# mount -o loop /home/user1/Downloads/rhel8.iso /rhel8

2. Create the repo file

# cp -v /rhel8/media.repo /etc/yum.repos.d/rhel8.repo
# chmod 644 /etc/yum.repos.d/rhel8.repo

3. Edit the repo file as follows

 # vim /etc/yum.repos.d/rhel8.repo[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///rhel8/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///rhel8/AppStream/

4. Disable RHEL subscription manager

# vim /etc/yum/pluginconf.d/subscription-manager.conf[main]
enabled=0

5. Check the repo list

# dnf clean all
# subscription-manager clean
# dnf repolist

6. Verify by installing rpms

# dnf install java-11-openjdk-devel
# java -version
# dnf module install nodejs:10
# node -version

--

--