Setup A Local YUM Repository On RHEL 8 From ISO Image


In this tutorial you will get to know how to create a local repository from RHEL 8 ISO Image to use redhat resources without subscription.

1.Mount the iso image.
     Attach the iso image to the system. If its a physical host insert the disc into the CDROM and         mount it. If its a VM(KVM), go through the procedures on how to attach an iso image to VM
      it will automatically mount it.

2. Copy iso image content to a directory
    Make a directory to store the packages.
    Now run the command below to copy all content on the iso image to  the directory.
    cp -rv /run/media/$USER/RHEL-8-1-0-BaseOS-x86_64/* /rhel   ###### /rhel is the directory I created
 

3. Create your repo file
    In /etc/yum.repos.d/ create a file ending .repo example; rhel.repo. vi into the file and edit it as follows;
   [BaseOS]
   name=BaseOS repo
   baseurl=file:///rhel/BaseOS ## put the location of the directory you copied the iso image content to.
   enabled=1
   gpgcheck=0

   [AppStream]
   name=AppStream repo
   baseurl=file:///rhel/AppStream
   enabled=1
   gpgcheck=0
 
  #save and exit
   

4. Clean all cache 
   Run dnf clean all to clean all cache
 

5. Confirm your repository is created and working.
   Run dnf repolist you should see the output below;
   

6. Disable Subscription Messages
    To avoid receiving subscription messages edit the file;
   /etc/dnf/plugins/subscription-manager.conf


 

save and exit

Now confirm if it worked. Run dnf repolist again or try installing a package.
 

Comments