How to create Local Repositories in RHEL

There're plenty of documents out there, given a set of RPM packages, you could do something like this,

First install the createrepo script, by

rpm -ivh /path/to/mounted/cdrom/createrepo*.rpm (Depends where you mounted your RedHat DVD)

Now create a folder to hold all RPMS that you want to be in the repository, e.g RPMS, and put the needed "*.rpm" files inside,

Then do createrepo /path/to/RPMS to generate metadata.

When finished, add the repository to your yum config, e.g put the following to /etc/yum.repos.d/local.repo

[local]
name=Local Repository Demo
baseurl=file:///absolute/path/to/RPMS
enabled=1
gpgcheck=0
protect=1

The first thing you need to do is:

Either (not both) of:

  1. Pay for a Red Hat subscription for the machine.
  2. Convert the system to CentOS.

Then you should find that you are able to access software and complete your task.