Translate

Archives

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.

$ http://example.com/repos/rhel6/


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.

[example]
name=RHEL6 $releasever - $basearch
baseurl=http://example.com/repos/rhel6/
enabled=1
gpgcheck=0

name=Fedora 16 $releasever - $basearch
baseurl=http://example.com/repos/fedora16/
enabled=1
gpgcheck=0


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 example.com, etc., with the correct host, directories, etc.

Comments are closed.