No results found

Your search did not match any results.

We suggest you try the following to help find what you’re looking for:

  • Check the spelling of your keyword search.
  • Use synonyms for the keyword you typed, for example, try “application” instead of “software.”
  • Try one of the popular searches shown below.
  • Start a new search.
Trending Questions

How to create a local Unbreakable Linux Network Mirror

By Jared Greenwald and Avi Miller
Published June 2012, Updated September 2014

Table of Contents

This document explains how to create a local mirror of the Unbreakable Linux Network repositories and configure yum to install and update packages from these repositories.


Ensure you have the following prerequisites:

  • A server running Oracle Linux 6 (x86_64 only) or Oracle Linux 7.
  • An active Internet connection, either direct or via a proxy server, that can access and via HTTP (port 80) and HTTPS (port 443).
  • A valid Oracle Linux customer support identifier (CSI). To purchase Oracle Linux support, go to the online Oracle Linux Store or contact your sales representative.
  • A valid Oracle Single Sign-On account and an activated Unbreakable Linux Network account.
  • Sufficient memory to create the yum metadata. At least 6GB of RAM is recommended to create the metadata for Oracle Linux 5 repositories, but at least 2GB is required.
  • Sufficient disk space to store a local copy of the mirrored channels. See disk storage requirements for minimum required disk space.

Server setup

The following steps describe how to mirror packages from selected channels on the Unbreakable Linux Network and make them available from a local yum server. You can create and host i386, x86_64, and ia64 repositories on the same server.

  1. Ensure that you have activated your Oracle Linux CSI and enabled your account on the Unbreakable Linux Network.
  2. Ensure that the yum-rhn-plugin RPM is installed and plugins=1 is enabled in /etc/yum.conf.
  3. Register the server with the Unbreakable Linux Network:

    For Oracle Linux 5:

    1. Import the RPM GPG key as the root user:
    2. # rpm --import /usr/share/rhn/RPM-GPG-KEY

    3. Run up2date in text mode:

      # up2date-nox --register

    4. Register the server by entering your Oracle Single Sign-On username, password and a valid CSI.

    For Oracle Linux 6 and Oracle Linux 7:

    1. Run the uln_register command as the root user:

      # uln_register

    2. Register the server by entering your Oracle Single Sign-On username, password and a valid CSI.
  4. Enable the yum server option for your newly registered server:
    1. Log in to the Unbreakable Linux Network with the username and password that you used to register the server.
    2. On the Systems tab, click the link named for your server in the list of registered servers.
    3. On the System Detail page, click Edit.
    4. On the Edit System Properties page, select the Yum Server checkbox and click Apply Changes.
  5. After registration with ULN, the server is automatically subscribed to the appropriate latest channel. You need to manually register the server to the correct addons channel to install the uln-yum-mirror package. If you are using Oracle Linux 5 as your ULN mirror server, subscribe to the el5_<arch>_addons channel. If you are using Oracle Linux 6, subscribe to the ol6_<arch>_addons channel. If you are using Oracle Linux 7, subscribe to the ol7_<arch>_addons channel.

  6. Subscribe the server to to the addons channel that is appropriate to the release of Oracle Linux installed on the server.
    1. On the System Details page, click Manage Subscriptions.
    2. Select the required channels from the Available Channels list and click > to add them to the Subscribed Channels list.
    3. When you have set up the Subscribed Channels list, click Save Subscriptions.

      If you want to add an additional channel to your yum mirror, add it to the Subscribed Channels list on ULN. The next time the uln-yum-mirror script runs, it automatically mirrors any additional channels that have been added. Disable server updates for any channels that you add as described in configuring the server for updates.

  7. Install the uln-yum-mirror package as the root user:

    # yum install uln-yum-mirror

    This command installs the /usr/bin/uln-yum-mirror script and automatically configures a daily cronjob to update your local yum repositories. You can adjust the configuration of the script by editing the /etc/sysconfig/uln-yum-mirror file. Configuration options are discussed in mirror configuration options.

  8. Create a yum repository base directory in /var/www/html.

    # mkdir -p /var/www/html/yum

    This directory will house the repository. Make sure that the yum repository owner has read and write permission on this directory.

  9. Enable and start the Apache web server. ]
    # chkconfig httpd on
    # service httpd start

How to configure the server for updates

To configure the server to be able to update itself from the local mirror, perform the following steps:

  1. Run the following command to get a list of channels being mirrored from ULN:
    # yum repolist
    Loaded plugins: rhnplugin, security
    This system is receiving updates from ULN.
    0 packages excluded due to repository protections
    repo id                   repo name                                                                       status
    ol6_x86_64_latest         Oracle Linux 6 Latest (x86_64)                                                  17,957
    ol6_x86_64_UEKR3_latest   Unbreakable Enterprise Kernel Release 3 for Oracle Linux 6 (x86_64) - Latest    41

    In the above example, the server is mirroring ol6_x86_64_latest and ol6_x86_64_UEKR3_latest.

  2. Edit /etc/yum/pluginconf.d/rhnplugin.conf and set all the channels being mirrored from ULN as disabled by adding the following stanza for each channel:
    [<repo id>]

    For example, to disable the channels listed in the above example, add the following two stanzas:

  3. Follow the client setup procedure to configure the server to install updates from itself.

This process will disable the ULN channels from being accessed by yum during normal operation but will not affect the uln-yum-mirror script functionality. If any channels are added on ULN, those channels must also be disabled in /etc/yum/pluginconf.d/rhnplugin.conf. Do NOT set enabled=0 in the [main] section of /etc/yum/pluginconf.d/rhnplugin.conf as this will disable the plugin completely and prevent uln-yum-mirror from being able to mirror ULN content.

How the repository synchronization works

The initial synchronisation will be triggered automatically overnight by the configured cronjob (unless manually disabled). If you have disabled the cronjob, run the uln-yum-mirror script manually to build the local yum repositories.

By default, the uln-yum-mirror is configured to run once a day via an /etc/cron.daily/uln-yum-mirror script. You can disable the automatic daily anacron job by editing /etc/sysconfig/uln-yum-mirror and setting CRON_ENABLED to 0.

Note: When the script first runs, it can take several days to complete, depending on the number of channels that are being mirrored and the available network bandwidth.

Mirror configuration options

The uln-yum-mirror script is controlled by the /etc/sysconfig/uln-yum-mirror configuration file. The following configuration options are available:

SRC = [ 0 | 1 ]

The SRC parameter determines whether or not the script also mirrors the associated .src.rpm files. The default is 0 which means the source packages are not mirrored. Change the value to 1 to include source packages in the mirror.

ALL_PKGS = [ 0 | 1 ]

The ALL_PKGS parameter specifies whether the script mirrors all available packages or just the latest packages in each channel. The default is 1 which means that all versions of every available package is mirrored. Set this to 0 to only download the latest version of each package.

CRON_ENABLED = [ 0 | 1 ]

The CRON_ENABLED parameter determines whether or not the daily anacron job is enabled for automatic mirroring of channels on a daily basis. If this parameter is set to 0, the uln-yum-mirror script will need to be manually run to update the local mirror.


The HARDLINK_RPMS parameter specifies whether hardlinkpy will run after the channel sychronization completes. This process will reduce the overall amount of disk space consumed by the repository by hardlinking identical packages on the filesystem.


The LOG_OUTPUT parameter specifies whether the output of the automatic cronjob is logged to /var/log/uln-yum-mirror.log.




These parameters specify the paths of the mirrored channels and yum cache directory. Do not change these settings unless you need to customize the configuration of the web server.






These parameters determine the repository name for each of the various channel types. You can configure an alternative name for each of the channel groups. The REP_ENG type is used by the Oracle Engineered Systems, e.g. Exadata and Exalogic.

Client setup

After you have set up the repository server, you can configure clients to use the repositories.

Setting up Oracle Linux clients

To configure an Oracle Linux server to receive updates from the local yum server, perform the following steps:

  1. Import the GPG key as the root user:

    # rpm --import /usr/share/rhn/RPM-GPG-KEY

  2. Create a yum repository configuration file in /etc/yum.repos.d using the following format:
    name=<Channel Description> 
    baseurl=http://<repository_server>/yum/<repository path>  

    For example:

    name=Oracle Linux $releasever - $basearch - latest

    You can browse http://<repository_server>/yum/ to find the baseurl for each repository. You can also use the $releasever and $basearch parameters.

  3. To test that yum is correctly configured to install and update packages from your local yum repository:
    1. Clear the yum metadata cache:

      # yum clean metadata

    2. Ensure the correct channels are configured:
      # yum repolist
      Loaded plugins: rhnplugin, security
      This system is receiving updates from ULN.
      0 packages excluded due to repository protections
      repo id                         repo name                                                                       status
      local_ol6_x86_64_latest         Oracle Linux 6 Latest (x86_64)                                                  17,957
      local_ol6_x86_64_UEKR3_latest   Unbreakable Enterprise Kernel Release 3 for Oracle Linux 6 (x86_64) - Latest    41

      To ensure that your local repositories do not conflict with upstream repositories, prefix their names with the string "local_".

Review the Oracle Linux Unbreakable Linux Network User's Guide for more information on using yum to install new packages and upgrade existing packages.

Setting up Oracle VM 3 clients

Oracle VM Manager is used to configure the repository used by the Oracle VM Servers it manages.

  1. For an Oracle VM 3 configuration, add the repository URL to the Oracle VM 3 Manager configuration by selecting Tools -> Server Update Management (YUM) and then entering the following information:

    YUM Base URL:


    Enable GPG Key:


    YUM GPG Key:


    Depending on your mirror configuration, you could use one of the following for the yum base URL instead:


Oracle VM Manager should be used to upgrade Oracle VM Servers. Check the Oracle VM documentation for instructions.

Known Issues

  1. On Oracle Linux 5, the /etc/sysconfig/rhn/sources file should not be modified from the default. Adding additional local repositories to this file will cause the ULN plugin to fail.
  2. On Oracle Linux 7, the path creation logic has been modified to make the local paths more readable. See Table 4 for a list of path changes. If you migrate to using Oracle Linux 7 as your local yum mirror, you will need to change the path for these repositories on any downstream client.


Disk storage requirements

The following tables contain estimates of the minimum disk space that is required to mirror the latest Oracle Linux and Oracle VM channels. These estimates are correct at the time of writing but are likely to change over time.

Table 1. Minimum Space Requirements for current Oracle Linux 5 Channels

Channel Label Latest Binaries All Binaries Latest Source & Binaries All Source & Binaries
el5_unsupported_<arch>_latest 2 GB 10 GB 2 GB 16 GB
el5_<arch>_addons 500 MB 4 GB 500 MB 6 GB
el5_<arch>_latest 4 GB 40 GB 8 GB 80 GB
el5_<arch>_oracle 1 GB 3 GB 1 GB 3 GB
ol5_u10_<arch>_base 4 GB 4 GB 7 GB 7 GB
ol5_u10_x86_64_patch 500 MB 1 GB 1 GB 2 GB
ol5_<arch>_ksplice 10 GB 130 GB - -
ol5_<arch>_latest 4 GB 25 GB 8 GB 45 GB
ol5_<arch>_UEK_latest 150 MB 4 GB 200 MB 6 GB

Table 2. Minimum Space Requirements for current Oracle Linux 6 Channels

Channel Label Latest Binaries All Binaries Latest Source & Binaries All Source & Binaries
ol6_playground_<arch>_latest 100 MB 3 GB 200 MB 6 GB
ol6_u4_<arch>_base 5 GB 5 GB 10 GB 10 GB
ol6_u4_<arch>_patch 2 GB 5 GB 3 GB 10 GB
ol6_<arch>_addons 300 MB 3 GB 300 MB 3 GB
ol6_<arch>_Dtrace_latest 100 MB 100 MB 200 MB 200 MB
ol6_<arch>_ksplice 12 GB 160 GB - -
ol6_<arch>_latest 7 GB 30 GB 15 GB 65 GB
ol6_<arch>_MySQL 200 MB 1 GB 200 MB 1 GB
ol6_<arch>_MySQL56 250 MB 500 MB 300 MB 500 MB
ol6_<arch>_oracle 350 MB 1 GB 350 MB 1 GB
ol6_<arch>_UEK_latest 100 MB 3 GB 200 MB 6 GB
ol6_<arch>_UEKR3_latest 200 MB 300 MB 250 MB 500 MB

Table 3. Minimum Space Requirements for current Oracle VM channels

Channel Label Latest Binaries All Binaries Latest Source & Binaries All Source & Binaries
ovm3_<arch>_latest 250 MB 2 GB 2 GB 4 GB

Table 4. Path changes on Oracle Linux 7

Channel Label Old Path (OL5 and OL6) New Path (OL7)
ol5_x86_64_ofed_UEK OracleLinux/OL5/x86_64/UEK/ofed OracleLinux/OL5/ofed/UEK/x86_64
ol6_x86_64_drbd83_utils OracleLinux/OL6/x86_64/utils/drbd83 OracleLinux/OL6/drbd83/utils/x86_64
ol6_x86_64_Dtrace_BETA OracleLinux/OL6/DtraceBETA/x86_64 OracleLinux/OL6/Dtrace_BETA/x86_64
ol6_x86_64_Dtrace_latest OracleLinux/OL6/Dtracelatest/x86_64 OracleLinux/OL6/Dtrace_latest/x86_64
ol6_x86_64_Dtrace_userspace_latest OracleLinux/OL6/x86_64/latest/Dtraceuserspace OracleLinux/OL6/Dtrace_userspace/latest/x86_64
ol6_x86_64_ofed_UEK OracleLinux/OL6/x86_64/UEK/ofed OracleLinux/OL6/ofed/UEK/x86_64
ol6_x86_64_UEKR3_latest OracleLinux/OL6/x86_64/latest/UEKR3 OracleLinux/OL6/UEKR3/latest/x86_64

See also

About the authors

  • Jared Greenwald is a Senior Developer at Oracle and one of the project leads for the Unbreakable Linux Network.
  • Avi Miller is a Product Management Director at Oracle and is the product manager for the Unbreakable Linux Network.
  • Revision 2.3, 09/16/2014