DEV Community

Ashish-Chorge
Ashish-Chorge

Posted on

Create a YUM server for RHEL 7.5 using its ISO file

This document is to create a YUM server using RHEL installer ISO file.

  • Install a RHEL VM with 2 GB RAM, 1 vCPU and 80 GB HDD.

  • Create a repository folder inside VM

mkdir -p /rhel75/repo
Enter fullscreen mode Exit fullscreen mode
  • Mount the ISO using mount command and copy the Packages folder into your repository folder
cp /run/media/vcloud/RHEL-7.5\ Server.x86_64/Packages/* /rhel75/repo/
Enter fullscreen mode Exit fullscreen mode
  • Install createrepo package if it is not installed during OS installation
cd /rhel75/repo
rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm
Enter fullscreen mode Exit fullscreen mode
  • Create repository
createrepo /rhcelab/repo/
Enter fullscreen mode Exit fullscreen mode
  • Clean YUM cache
yum clean all
Enter fullscreen mode Exit fullscreen mode
  • Update the rhcelab.repo file to point to your local repository folder
vi /etc/yum.repos.d/rhcelab.repo
[rhcerepo]
name=rhcerepo
baseurl=file:///rhel75/repo/
enabled=1
gpgcheck=0
Enter fullscreen mode Exit fullscreen mode
  • List the repolist
yum repolist
Enter fullscreen mode Exit fullscreen mode
  • For testing, try to install any package
yum install redhat-lsb
Enter fullscreen mode Exit fullscreen mode

Top comments (0)