With these 5 steps, anyone can easily build a Red Hat library-based repository locally. 

  • Step 1: Install the RPM package createrepo on the repository server yum install createrepo
  • Step 2: set up the web server (e.g. Apache) 
  • Step 3: Create a folder for the RPM files (e.g. myrepo) mkdir -p /data/repo/myrepo 
  • Step 4: create the repository metafiles createrepo /data/repo/myrepo 
  • Step 5: create YUM configuration file vim /etc/yum.repos.d/myrepo.repo