Five Steps To Creating a Yum Repository Available on Your Network

Q.  How do you create a yum repository server on a network?

1.  Put the .rpm files into a directory (e.g., /mnt/coolrepo).
2.  Enter this command: createrepo /mnt/coolrepo
     a) Install Apache. 
     b)  Configure the httpd.conf file to make the /mnt/coolrepo file presentable over the network. 
           cd /; find . -name    httpd.conf
           vi httpd.conf
           Edit the DocumentRoot stanza to have the value be /mnt/coolrepo
           Save the changes
      c)  apachectl start
      d)  Configure the firewall so it will allow clients to connect.  If you are allowed to, you may want to turn off the firewall.

4.  Go to a server that will be a client of this repo server.  Create a new file called:


Make sure it has these stanzas:
baseurl=http://IPaddress/coolrepo   # *
gpgcheck=0  # **

* Replace "IPaddress" with the IP address of the Yum repo server.  The protocol could be a file:///, https://, or an ftp:// constructor.
** use this option with care.  If gpgchecks are disabled on your system, this will allow the repo to work without signatures on client machines (e.g., in the file above).  If the configuration is for a one-time download and installation or if the repository is for a proof of concept in a development or QA environment, it is probably acceptable.  For security purposes, you may want to keep it GPGchecks enabled.  If someone spoofed your Yum repository server, the client (or consumer) servers so configured could get malware installed.  Benign rpm package names could furtively be spyware and installed during the course of normal system administration operations.

5.  On the client, issue this command to test it: yum install nameOfRPMfile

Leave a comment

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