Last updated: 26 May, 2009
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, x86_64, and ia64
repositories can be created and hosted on a single machine.
- Register the machine on the Unbreakable Linux Network.
- Import the RPM GPG key
rpm --import /usr/share/rhn/RPM-GPG-KEY
- Run up2date in text mode.
up2date-nox --register
- Register the machine. Enter username, password, and a valid CSI.
- Subscribe the machine to all desired channels
- Open up a web browser and go to linux.oracle.com.
- Log in with username and password that were used to register the machine
- Click on the Systems tab on the upper right corner
- Find the registered machine on the list and click on it
- Click on the EDIT button
- Check the Yum Server checkbox and click on the Apply Changes button
-
Check all channels for which you wish to create yum repositories for and click subscribe.
- Enterprise Linux 4
| i386 Channel |
x86_64 Channel |
IA64 Channel |
Description |
| el4_i386_latest |
el4_x86_64_latest |
el4_ia64_latest |
Enterprise Linux 4 latest updates |
| el4_i386_addons |
el4_x86_64_addons |
N/A |
Enterprise Linux 4 addons packages |
| el4_i386_oracle |
el4_x86_64_oracle |
N/A |
Oracle Software for Enterprise Linux 4 |
| el4_u4_i386_base |
el4_u4_x86_64_base |
N/A |
Enterprise Linux 4 Update 4 base packages |
| el4_u5_i386_base |
el4_u5_x86_64_base |
N/A |
Enterprise Linux 4 Update 5 base packages |
| el4_u6_i386_base |
el4_u6_x86_64_base |
el4_u6_ia64_base |
Enterprise Linux 4 Update 6 base packages |
| el4_u7_i386_base |
el4_u7_x86_64_base |
el4_u7_ia64_base |
Enterprise Linux 4 Update 7 base packages |
| el4_u8_i386_base |
el4_u8_x86_64_base |
el4_u8_ia64_base |
Enterprise Linux 4 Update 8 base packages |
| el4_u4_i386_patch |
el4_u4_x86_64_patch |
N/A |
Enterprise Linux 4 Update 4 patches |
| el4_u5_i386_patch |
el4_u5_x86_64_patch |
N/A |
Enterprise Linux 4 Update 5 patches |
| el4_u6_i386_patch |
el4_u6_x86_64_patch |
el4_u6_ia64_patch |
Enterprise Linux 4 Update 6 patches |
| el4_u7_i386_patch |
el4_u7_x86_64_patch |
el4_u7_ia64_patch |
Enterprise Linux 4 Update 7 patches |
| el4_u8_i386_patch |
el4_u8_x86_64_patch |
el4_u8_ia64_patch |
Enterprise Linux 4 Update 8 patches |
- Enterprise Linux 5
| 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_u1_i386_base |
el5_u1_x86_64_base |
Enterprise Linux 5 Update 1 base packages |
| el5_u2_i386_base |
el5_u2_x86_64_base |
Enterprise Linux 5 Update 2 base packages |
| el5_u3_i386_base |
el5_u3_x86_64_base |
Enterprise Linux 5 Update 3 base packages |
| el5_ga_i386_patch |
el5_ga_x86_64_patch |
Enterprise Linux 5 GA patches |
| el5_u1_i386_patch |
el5_u1_x86_64_patch |
Enterprise Linux 5 Update 1 patches |
| el5_u2_i386_patch |
el5_u2_x86_64_patch |
Enterprise Linux 5 Update 2 patches |
| el5_u3_i386_patch |
el5_u3_x86_64_patch |
Enterprise Linux 5 Update 3 patches |
- Oracle VM
| Channel |
Description |
| ovm2_i386_latest |
Oracle VM 2 latest updates |
| ovm2_2.1.0_i386_base |
Oracle VM 2.1.0 base packages |
| ovm2_2.1.1_i386_base |
Oracle VM 2.1.1 base packages |
| ovm2_2.1.2_i386_base |
Oracle VM 2.1.2 base packages |
| ovm2_2.1.0_i386_patch |
Oracle VM 2.1.0 patches |
| ovm2_2.1.1_i386_patch |
Oracle VM 2.1.1 patches |
| ovm2_2.1.2_i386_patch |
Oracle VM 2.1.2 patches |
-
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.
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 |
| ovm2_*_base |
400M |
800M |
| ovm2_*_patch |
100M |
200M |
- Populate the repository
-
Download rep_populate.sh.
Edit repository locations in the script if they are different from what you have.
-
Register the machine to correct latest and addons channels. Required
channels depend on the version and architecture of the OS that is
running on the machine.
| OS |
Arch |
Required Channels |
| Enterprise Linux 4 |
i386 |
el4_i386_latest |
el4_i386_addons |
| Enterprise Linux 4 |
x86_64 |
el4_x86_64_latest |
el4_x86_64_addons |
| Enterprise Linux 5 |
i386 |
el5_i386_latest |
el5_i386_addons |
| Enterprise Linux 5 |
x86_64 |
el5_x86_64_latest |
el5_x86_64_addons |
This allows rep_populate.sh to install the uln-yum-proxy package, which
in turn will install packages needed to create yum repositories.
- 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
- Start the web server
chkconfig httpd on /etc/init.d/httpd start
-
Please update the repository regularly by running rep_populate.sh,
It is recommended that this be done once or twice a day.
Client Setup
- Import the GPG key
rpm --import /usr/share/rhn/RPM-GPG-KEY
- 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.
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_u5_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/5/base/$ARCH/
#yum el4_u6_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/6/base/$ARCH/
#yum el4_u7_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/7/base/$ARCH/
#yum el4_u8_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL4/8/base/$ARCH/
#
#yum el4_u4_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/4/patch/$ARCH/
#yum el4_u5_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/5/patch/$ARCH/
#yum el4_u6_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/6/patch/$ARCH/
#yum el4_u7_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/7/patch/$ARCH/
#yum el4_u8_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL4/8/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_u1_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL5/1/base/$ARCH/
#yum el5_u2_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL5/2/base/$ARCH/
#yum el5_u3_$ARCH_base http://<repository_server>/yum/EnterpriseLinux/EL5/3/base/$ARCH/
#
#yum el5_ga_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/ga/patch/$ARCH/
#yum el5_u1_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/1/patch/$ARCH/
#yum el5_u2_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/2/patch/$ARCH/
#yum el5_u3_$ARCH_patch http://<repository_server>/yum/EnterpriseLinux/EL5/3/patch/$ARCH/
- Oracle VM
yum ovm2_i386_latest http://<repository_server>/yum/OracleVM/OVM2/latest/i386/
#
#yum ovm2_2.1.0_i386_base http://<repository_server>/yum/OracleVM/OVM2/2.1.0/base/i386/
#yum ovm2_2.1.1_i386_base http://<repository_server>/yum/OracleVM/OVM2/2.1.1/base/i386/
#yum ovm2_2.1.2_i386_base http://<repository_server>/yum/OracleVM/OVM2/2.1.2/base/i386/
#
#yum ovm2_2.1.0_i386_patch http://<repository_server>/yum/OracleVM/OVM2/2.1.0/patch/i386/
#yum ovm2_2.1.1_i386_patch http://<repository_server>/yum/OracleVM/OVM2/2.1.1/patch/i386/
#yum ovm2_2.1.2_i386_patch http://<repository_server>/yum/OracleVM/OVM2/2.1.2/patch/i386/
- The following steps are required for users using the yum client
-
Install python-urlgrabber if it is not already installed. This applies only to
x86_64 versions of Enterprise Linux 4 U4 and U5.
- If commented out, uncomment the line in /etc/sysconfig/rhn/sources that begins with
#yum el4_addons [...]
- Run up2date to install python-urlgrabber.
up2date -i python-urlgrabber
- Comment out the line in /etc/sysconfig/rhn/sources if needed.
-
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.
[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_u5_base]
name=Enterprise Linux $releasever U5 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/base/$basearch/
gpgcheck=1
enabled=0
[el4_u6_base]
name=Enterprise Linux $releasever U6 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/6/base/$basearch/
gpgcheck=1
enabled=0
[el4_u7_base]
name=Enterprise Linux $releasever U7 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/7/base/$basearch/
gpgcheck=1
enabled=0
[el4_u8_base]
name=Enterprise Linux $releasever U8 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/8/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_patch]
name=Enterprise Linux $releasever U5 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/5/patch/$basearch/
gpgcheck=1
enabled=0
[el4_u6_patch]
name=Enterprise Linux $releasever U6 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/6/patch/$basearch/
gpgcheck=1
enabled=0
[el4_u7_patch]
name=Enterprise Linux $releasever U7 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/7/patch/$basearch/
gpgcheck=1
enabled=0
[el4_u8_patch]
name=Enterprise Linux $releasever U8 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL4/8/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_u1_base]
name=Enterprise Linux $releasever U1 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/1/base/$basearch/
gpgcheck=1
enabled=0
[el5_u2_base]
name=Enterprise Linux $releasever U2 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/2/base/$basearch/
gpgcheck=1
enabled=0
[el5_u3_base]
name=Enterprise Linux $releasever U3 - $basearch - base
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/3/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_patch]
name=Enterprise Linux $releasever U1 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/1/patch/$basearch/
gpgcheck=1
enabled=0
[el5_u2_patch]
name=Enterprise Linux $releasever U2 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/2/patch/$basearch/
gpgcheck=1
enabled=0
[el5_u3_patch]
name=Enterprise Linux $releasever U3 - $basearch - patch
baseurl=http://<repository_server>/yum/EnterpriseLinux/EL5/3/patch/$basearch/
gpgcheck=1
enabled=0
- Oracle VM
[ovm2_latest]
name=Oracle VM 2 - i386 - latest
baseurl=http://<repository_server>/yum/OracleVM/OVM2/latest/i386/
gpgcheck=1
enabled=1
[ovm2_2.1.0_base]
name= Oracle VM 2.1.0 - i386 - base
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.0/base/i386/
gpgcheck=1
enabled=0
[ovm2_2.1.1_base]
name= Oracle VM 2.1.1 - i386 - base
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.1/base/i386/
gpgcheck=1
enabled=0
[ovm2_2.1.2_base]
name= Oracle VM 2.1.2 - i386 - base
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.2/base/i386/
gpgcheck=1
enabled=0
[ovm2_2.1.0_patch]
name= Oracle VM 2.1.0 - i386 - patch
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.0/patch/i386/
gpgcheck=1
enabled=0
[ovm2_2.1.1_patch]
name= Oracle VM 2.1.1 - i386 - patch
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.1/patch/i386/
gpgcheck=1
enabled=0
[ovm2_2.1.2_patch]
name= Oracle VM 2.1.2 - i386 - patch
baseurl=http://<repository_server>/yum/OracleVM/OVM2/2.1.2/patch/i386/
gpgcheck=1
enabled=0
-
You are now ready to use up2date (and yum, if configured) to
install and update files from your local yum repository. For example:
up2date -u
yum update
|