Last updated: 25 Feb, 2008

Yum Repository Setup

This document explains how to create local yum repositories and configure up2date and yum to install and update packages from them.

Server Setup

Prerequisites:

  • A machine running Enterprise Linux 4 or Enterprise Linux 5, for i386 or x86_64
  • A valid CSI

The steps below describe how to download latest packages from Unbreakable Linux Network and make them available through a local yum server. i386 and x86_64 repositories can be created and hosted on a single machine.

  1. Register the machine on the Unbreakable Linux Network.
    1. Import the RPM GPG key
    2. rpm --import /usr/share/rhn/RPM-GPG-KEY
    3. Run up2date in text mode.
    4. up2date-nox --register
    5. Register the machine. Enter username, password, and a valid CSI.

  2. Subscribe the machine to all desired channels
    1. Open up a web browser and go to linux.oracle.com.
    2. Log in with username and password that were used to register the machine
    3. Click on the Systems tab on the upper right corner
    4. Find the registered machine on the list and click on it
    5. Click on the EDIT button
    6. Check the Yum Server checkbox and click on the Apply Changes button
    7. Check all channels for which you wish to create yum repositories for and click subscribe.
      • Enterprise Linux
      • i386 Channel x86_64 Channel Description
        el4_i386_latest el4_x86_64_latest Enterprise Linux 4 latest updates
        el4_i386_addons el4_x86_64_addons Enterprise Linux 4 addons packages
        el4_i386_oracle el4_x86_64_oracle Oracle Software for Enterprise Linux 4
        el4_u4_i386_base el4_u4_x86_64_base Enterprise Linux 4 Update 4 base packages
        el4_u4_i386_patch el4_u4_x86_64_patch Enterprise Linux 4 Update 4 patches
        el4_u5_i386_base el4_u5_x86_64_base Enterprise Linux 4 Update 5 base packages
        el4_u5_i386_patch el4_u5_x86_64_patch Enterprise Linux 4 Update 5 patches
        el4_u6_i386_base el4_u6_x86_64_base Enterprise Linux 4 Update 6 base packages
        el4_u6_i386_patch el4_u6_x86_64_patch Enterprise Linux 4 Update 6 patches
        i386 Channel x86_64 Channel Description
        el5_i386_latest el5_x86_64_latest Enterprise Linux 5 latest updates
        el5_i386_addons el5_x86_64_addons Enterprise Linux 5 addons packages
        el5_i386_oracle el5_x86_64_oracle Oracle Software for Enterprise Linux 5
        el5_ga_i386_base el5_ga_x86_64_base Enterprise Linux 5 GA base packages
        el5_ga_i386_patch el5_ga_x86_64_patch Enterprise Linux 5 GA patches
        el5_u1_i386_base el5_u1_x86_64_base Enterprise Linux 5 U1 base packages
        el5_u1_i386_patch el5_u1_x86_64_patch Enterprise Linux 5 U1 patches
      • Oracle VM
      • Channel Description
        ovm2_i386_latest Oracle VM 2 latest updates

  3. Create a yum repository base directory in /var/www/html. This directory will house the repository. Make sure that the yum repository owner has the read/write permission to this directory.
  4. mkdir -p /var/www/html/yum
    Approximate space requirements for each channel:

    Channel

    Binaries Only

    Binaries and Source

    el*_latest 3G 5.5G
    el*_addons 600M 1G
    el*_oracle 1G N/A
    el*_base 3G 5.5G
    el*_patch 1G 2G
    ovm2_i386_latest 500M 1G

  5. Populate the repository
    1. Download rep_populate.sh. Edit repository locations in the script if they are different from what you have.
    2. Register the machine to appropriate addons and latest channels. This will allow rep_populate.sh to install the uln-yum-proxy package, which in turn will install packages needed to create yum repositories.
    3. Run rep_populate.sh. This will create yum repositories for the channels registered.
      • Binary RPMs only
      • To download binary RPMs only, run the script without any options.
        sh rep_populate.sh
      • Binary and source RPMs
      • To download both binary and source RPMs, run the script with option "src".
        sh rep_populate.sh src
  6. Start the web server
  7. chkconfig httpd on
    /etc/init.d/httpd start
  8. Please update the repository regularly by running rep_populate.sh, It is recommended that this be done once or twice a day.

Client Setup

  1. Import the GPG key
  2. rpm --import /usr/share/rhn/RPM-GPG-KEY
  3. Configure up2date to use the yum repository. Edit /etc/sysconfig/rhn/sources. Comment out line
    up2date default
    to
    #up2date default

    and add the following lines. Replace <repository_server> with the hostname of the machine that is hosting the yum repository. Comment and uncomment individual repositories as needed.

    • Enterprise Linux 4
    • yum el4_$ARCH_latest http://<repository_server>/yum/EnterpriseLinux/EL4/latest/$ARCH/
      #yum el4_$ARCH_addons http://<repository_server>/yum/EnterpriseLinux/EL4/addons/$ARCH/
      #yum el4_$ARCH_oracle http://<repository_server>/yum/EnterpriseLinux/EL4/oracle/$ARCH/
      #yum el4_u4_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/4/base/$ARCH/
      #yum el4_u4_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/4/patch/$ARCH/
      #yum el4_u5_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/5/base/$ARCH/
      #yum el4_u5_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/5/patch/$ARCH/
      #yum el4_u6_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/6/base/$ARCH/
      #yum el4_u6_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/6/patch/$ARCH/
    • Enterprise Linux 5
    • yum el5_$ARCH_latest http://<repository_server>/yum/EnterpriseLinux/EL5/latest/$ARCH/
      #yum el5_$ARCH_addons http://<repository_server>/yum/EnterpriseLinux/EL5/addons/$ARCH/
      #yum el5_$ARCH_oracle http://<repository_server>/yum/EnterpriseLinux/EL5/oracle/$ARCH/
      #yum el5_ga_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL5/ga/base/$ARCH/
      #yum el5_ga_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/ga/patch/$ARCH/
      #yum el5_u1_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL5/1/base/$ARCH/
      #yum el5_u1_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/1/patch/$ARCH/
    • Oracle VM
    • yum ovm2_i386_latest http://<repository_server>/yum/OracleVM/OVM2/latest/i386
  4. The following steps are required for users using the yum client
    1. Install python-urlgrabber if it is not already installed. This applies only to x86_64 versions of Enterprise Linux 4 U4 and U5.
      1. If commented out, uncomment the line in /etc/sysconfig/rhn/sources that begins with
      2. #yum el4_addons [...]
      3. Run up2date to install python-urlgrabber.
      4. up2date -i python-urlgrabber
      5. Comment out the line in /etc/sysconfig/rhn/sources if needed.

    2. Replace /etc/yum.repos.d/ULN-Base.repo with the following. Note that only the latest channel is enabled by default. Replace <repository_server> with the hostname of the machine that is hosting the yum repository.

      • Enterprise Linux 4
      • [el4_latest]
        name=Enterprise Linux $releasever - $basearch - latest
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/latest/$basearch/
        gpgcheck=1
        enabled=1
        
        [el4_addons]
        name=Enterprise Linux $releasever - $basearch - addons
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/addons/$basearch/
        gpgcheck=1
        enabled=1
        
        [el4_oracle]
        name=Enterprise Linux $releasever - $basearch - oracle
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/oracle/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u4_base]
        name=Enterprise Linux $releasever U4 - $basearch - base
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/4/base/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u4_patch]
        name=Enterprise Linux $releasever U4 - $basearch - patch
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/4/patch/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u5_base]
        name=Enterprise Linux $releasever U5 - $basearch - base
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/base/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u5_patch]
        name=Enterprise Linux $releasever U5 - $basearch - patch
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/patch/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u6_base]
        name=Enterprise Linux $releasever U6 - $basearch - base
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/base/$basearch/
        gpgcheck=1
        enabled=0
        
        [el4_u6_patch]
        name=Enterprise Linux $releasever U6 - $basearch - patch
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/patch/$basearch/
        gpgcheck=1
        enabled=0
      • Enterprise Linux 5
      • [el5_latest]
        name=Enterprise Linux $releasever - $basearch - latest
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/latest/$basearch/
        gpgcheck=1
        enabled=1
        
        [el5_addons]
        name=Enterprise Linux $releasever - $basearch - addons
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/addons/$basearch/
        gpgcheck=1
        enabled=0
        
        [el5_oracle]
        name=Enterprise Linux $releasever - $basearch - oracle
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/oracle/$basearch/
        gpgcheck=1
        enabled=0
        
        [el5_ga_base]
        name=Enterprise Linux $releasever GA - $basearch - base
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/ga/base/$basearch/
        gpgcheck=1
        enabled=0
        
        [el5_ga_patch]
        name=Enterprise Linux $releasever GA - $basearch - patch
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/ga/patch/$basearch/
        gpgcheck=1
        enabled=0
        
        [el5_u1_base]
        name=Enterprise Linux $releasever U1 - $basearch - base
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/1/base/$basearch/
        gpgcheck=1
        enabled=0
        
        [el5_u1_patch]
        name=Enterprise Linux $releasever U1 - $basearch - patch
        baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/1/patch/$basearch/
        gpgcheck=1
        enabled=0
      • Oracle VM
      • [ovm2_i386_latest]
        name=Oracle VM 2 - i386 - latest
        baseurl=http://<repository_server>/yum/OracleVM/OVM2/latest/i386
        gpgcheck=1
        enabled=1
  5. You are now ready to use up2date (and yum, if configured) to install and update files from your local yum repository. For example:
  6. up2date -u

    yum update
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy