Creating a YUM Repo

 

Install the create repo package

yum install createrepo

Make a directory for your repo

mkdir -p /local/mrepo/RedHat5_X64_09_2014

Copy your rpms in to the new directory

 cp -p *.rpm /local/mrepo/RedHat5_X64_09_2014

Run the createrepo command to make the repo.

 createrepo /local/mrepo/RedHat5_X64_09_2014

You now have a repo.

Now  to create the YUM redo definition.

[repository ID]
name=repository name
baseurl=url, file or ftp://path to repository
yum install createrepo

YUM repo http definition.

 

yum install yum-plugin-security
[RH5Server-x86_64-012014]
enabled=1
gpgcheck=0
name=Red Hat Enterprise Linux 5 - Jan 2014
baseurl=http://10.10.10.1-/mrepo/5Server-x86_64-012014

Now to set up http service.

    1. Install the Apache HTTP server.
      # yum install httpd
    1. If you created repo directory for the yum repository that is not n /var/www/html, either create a symbolic link in /var/www/html that points to the repository directory or define a directory in httpd.conf or a file in /etc/httpd/conf.d
      # ln -s /local/mrepo /var/www/html/mrepo

      In httpd.conf add a directory definition

      Alias /mrepo /local/mrepo
      
      <Directory /local/mrepo>
              Options Indexes FollowSymlinks SymLinksifOwnerMatch IncludesNOEXEC
      </Directory>
      
      

Leave a Reply

Your email address will not be published. Required fields are marked *