Cool Solutions

Set Up A Local YUM Repository



By:

June 27, 2008 3:06 pm

Reads: 13603

Comments:2

Score:0

By Sreehari Cheerla, Santosh M

Yellowdog Updater Modifier (YUM) is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.

Features include:

  • Multiple Repositories
  • Correct dependency calculation
  • Fast operation
  • rpm-consistent behavior

YUM makes it easy to keep the systems in a network running with the latest patches. If your network has multiple machines that need to be updated, you may want to run a local YUM server that caches the updates.

Setting up a local YUM Repo server is a simple process and can be done quickly. You’ll need to:

  • Set up the local YUM Repo server
  • Set up clients to pull updates from the local YUM Repo server

Set Up The Local YUM Repo Server

Setting up the local YUM Server requires the following steps:

  1. Install and Configure Apache to support YUM
  2. Install Create Repo
  3. Configure the YUM Server

Install and Configure Apache to support YUM:

  1. Install Apache Using YAST and start the Apache service using “rcapache2 start”
  2. Create a symbolic link of the location which needs to be hosted or where Updates available under /srv/www/htdocs .

    Eg : ln -s /Updates /srv/www/htdocs

  3. Configure Apache in order to support as YUM source by editing /etc/apache2/default-server.conf file. Add the following content to this file and restart Apache.
    <Directory "/var/www/html">
         Options None
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>
    <IfDefine SSL>
         SSLEngine off
    </IfDefine>
  4. Restart Apache
    /etc/init.d/apache2 restart
  5. Note: If Port 80 is already in use, change the port number in /etc/apache2/listen.conf, eg: Listen 800

Install Create Repo:

Install createrepo rpm by downloading from http://rpmfind.net

Configure the YUM Server:

  1. Copy the updates to a folder (Eg: /Updates/SLES10, /Updates/SLED10,/SLES10-SP1, /Updates/SLED10-SP1). Place all updates under similar folder structure.
  2. Run the below command

    createrepo <DIRNAME>
    Eg: createrepo /Updates

    This would generate required meta data.

Set Up Clients To Pull Updates From The Local YUM Repo Server

To configure a client system to pull updates from the local YUM server Using rug command follow below steps:

  1. Add the service using rug service add command Using “rug sa <servername> -t yum <servicename >”
    rug sa http://164.99.98.45/Updates -t yum updates
  2. Verify the Catalogs using “rug ca” command and Subscribe the catalog using “rug sub <catalogname>”
  3. Now Update the software using “rug up” command .
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

2 Comments

  1. By:peterhine

    “Copy the updates to a folder (Eg: /Updates/SLES10, /Updates/SLED10,/SLES10-SP1, /Updates/SLED10-SP1). Place all updates under similar folder structure.”

    where did the updates come from in the first place ?

    what method or tool do we use to keep this repo up to date ?

    after updating the repo, does “createrepo ” need to be rerun ?

    may i suggest using “http://software.opensuse.org/search” instead of rpmfind. search under “sled/sles 10″ category.

    thanks
    Peter

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  2. By:Anonymous

    How can we do to make some important packages updates first and then later the rest of packages? I don’t want all the updates simultaneity. It’s possible?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Comment

RSS