Setup Local Yum Server on RHEL8

# mkdir /rhel8For physical dvd,
# mount /dev/sr0 /rhel8
For ISO,
# mount -o loop /dev/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

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Himanshu Pratap

Himanshu Pratap

System Administrator and Full stack web developer.