Set up local RPM Installation Repository

There are a number of ways of installing additional RPM packages from installation media. However, if your network is fast and you are installing the same packages on a number of systems, it sometimes is easier to set up a simple local package repository and use yum to install the packages from there. This post shows you how to do this.

Copy the new packages, or even the contents of an entire distribution to a suitable subdirectory on a local webserver. For example, if you are using an Apache webserver on RHEL or Fedora, suitable locations would probably be /var/www/html/repos/rhel6/ for RHEL6 and /var/www/html/repos/Fedora16 for Fedora 16.

Check that the subdirectory that you placed the files in is served by the webserver.


if you cannot see this directory in your browser, you need to fix the problem before you go any further.

Next, you need to create a new repository configuration file on the systems that need packages. Using vi or your favorite editor add the following lines to /etc/yum.repos.d/example.repo.

name=RHEL6 $releasever - $basearch

name=Fedora 16 $releasever - $basearch

and save the newly created file. Then you should be able to use yum to install packages from you local webserver.

That is all there is to it. Obviously, you need to replace, etc., with the correct host, directories, etc.

Comments are closed.