You are here

Oracle Linux Yum Server Setup

This chapter of the Oracle Cloud Cookbook describes how to setup an Oracle Linux yum server using the Oracle Unbreakable Linux Networkand the Oracle public yum server with Oracle Linux, Red Hat Enterprise Linux, Oracle VM, and Oracle engineered system clients.

Author: Roddy Rodstein

Table of Contents

 

Oracle Linux Yum Server Setup Introduction

An Oracle Linux yum server can be used to host Oracle Linux, Red Hat Enterprise Linux, Oracle VM, and Oracle engineered systems RPM packages, the latest software patches, updates and fixes. With an Oracle Linux yum server, administrators can centrally manage and install RPM packages and updates locally over your network, not over the internet, using a yum client. An Oracle Linux yum server can also host custom channels with Oracle RPMs and 3rd party RPMs. A custom channel is a RPM repository created by you to host a collection of RPM packages from Oracle or any vendor, i.e. EMC, HP, IBM, Red Hat, Open Source, etc..
 
An Oracle Linux YUM Server can be configured to host Oracle Unbreakable Linux Network RPMs, Oracle public yum server RPMs as well as custom channels. The Oracle Unbreakable Linux Network and the Oracle public yum server are Oracle' cloud repositories for Oracle VM, Oracle Linux, Red Hat Enterprise Linux, and Oracle engineered systems RPMs, software patches, updates and fixes. Access to Unbreakable Linux Network requires an Oracle Single Sign-on account, a valid customer service identifier (CSI) and registration. Access to the Oracle public yum server is open to the public without registration.
 
Table 1 reviews the Oracle Linux yum server components:
Unbreakable Linux Network (ULN)
The Oracle Unbreakable Linux Network is Oracle' cloud repository for Oracle VM, Oracle Linux, Red Hat Enterprise Linux, and Oracle engineered systems RPMs, software patches, updates and fixes. The Oracle Unbreakable Linux Network is part of the Oracle Linux support program.
Oracle Linux SupportOracle Linux is not a licensed Oracle technology product. There are no license fees for Oracle Linux. Oracle offers enterprise support for Oracle Linux on third-party hardware as well as bundled support with Sun hardware. Support for Oracle Linux for third-party hardware is purchased as an add-on component of Oracle’s enterprise support package. Support for Oracle Linux on Sun x64 hardware is bundled with hardware support as an add-on to the Premier Support for Systems package.
Customer Service IdentifierA valid Oracle Linux and/or Oracle VM customer service identifier (CSI) is required to access the RPM repositories, software patches, updates and fixes at the Oracle Unbreakable Linux Network. Oracle Linux and/or Oracle VM customer service identifiers (CSIs) are only valid for the Oracle Unbreakable Linux Network, not for My Oracle Support.
Oracle public yum server
The Oracle public yum server is Oracle' public cloud repository for Oracle VM, Oracle Linux and Red Hat Enterprise Linux RPMs, software patches, updates and fixes.
ULN Channel
An Unbreakable Linux Network channel is a collection of RPM packages hosted on Unbreakable Linux Network. The Oracle Unbreakable Linux Network hosts ULN Channels for Oracle Linux, Red Hat Enterprise Linux, Oracle VM, and Oracle engineered systems.
RPM Repository
A RPM repository is a directory on an Apache web server which contains RPM packages.
Yum serverA yum server hosts RPM packages for yum clients. The Oracle Unbreakable Linux Network and Oracle public yum servers host Oracle's RPM channels. The RPM channels include the base OS version installation RPM packages along with the latest software patches, updates and fixes. With a local Oracle yum server, Oracle Linux, Red Hat Enterprise Linux, Oracle VM, and Oracle engineered systems nodes can install packages and updates locally over your network, not over the internet, using the yum client. Custom channels can be created with 3rd party RPM packages to install packages and updates from any vendor, i.e. EMC, HP, IBM, Red Hat, Open Source, etc..
Custom Channel
A custom channel is a RPM repository created by the user to host a collection of RPM packages.
 
Oracle's public yum server allows us to keep Oracle Linux, Red Hat Enterprise Linux, and Oracle VM system up to date to the latest update version, using the "_latest" RPM repository. The Oracle public yum repository RPMs, patches, updates and erratas do not include Oracle support or any of the benefits of the Oracle Linux Support program.
 
The Oracle Linux Support program offers the following benefits over and above the free Oracle Linux RPM patches, updates and erratas from the Oracle public yum server:
  • Full indemnification against intellectual property claims.
  • Use of the Oracle Enterprise Manager 12c Linux Host Patching feature, and Spacewalk v2 for patch management. Oracle Enterprise Manager 12c Linux Host Patching feature,  and Spacewalk v2 has feature parity with Red Hat Satellite Server.
  • Use of the Oracle Enterprise Manager 12c Virtualization Plug-in for Oracle VM for provisioning, patching, management and monitoring.
  • Access to additional Oracle software channels on the Unbreakable Linux Network (ULN).
  • Patch channels for each Linux update level.
  • The ability to create Support Requests with Oracle' World Class support organization.
The Oracle public yum server latest RPM channel include the base OS version installation RPM packages along with the latest software patches, updates and fixes. Patch jobs using the latest RPM channel update hosts to their respected latest version update with the latest software patches, updates and fixes. A patch job executed on a Oracle Linux 6 host would update the host from 6 to 6U3 with the latest latest software patches, updates and fixes. To keep a host at its respected update level, a valid CSI and the Unbreakable Linux Network is required. With the Unbreakable Linux Network, it is possible to register a host the el*/ol*_base channel along with the el*/ol*_patch RPM channel. When hosts are patched using the el*/ol*_base and el*/ol*_patch RPM channels, the hosts are patched with the latest software patches, updates and fixes from their respected update channel, i.e. 6, 6U1, 6U2 and 6U3.
 
With an Oracle Linux yum Server, Linux, Oracle VM, and engineered systems can install packages and updates locally over your network, not over the internet, using the yum client. Custom channels can be created with 3rd party RPM packages to install packages and updates from any vendor, i.e. EMC, HP, IBM, Red Hat, Open Source, etc...
 
The following table shows the steps to setup an Oracle Linux Yum Server using the Unbreakable Linux Network.
Step 1
Step 2
Step 3
Step 4
Step 5
Register the Linux host with ULN
Install and Setup Apache
Access ULN, enable YUM, and select RPM channels
Synchronize the Linux Yum server with ULN
Setup Yum clients
 
The following table shows the steps to setup an Oracle Linux Yum Server using the Oracle public yum repository.
Step 1
Step 2
Step 3
Install and Setup Apache
Synchronize the Linux Yum server with the Oracle public yum repository
Setup Yum clients
The chapter is broken into three sections. The first section reviews how to setup an Oracle Yum server using the Unbreakable Linux Network. The second section reviews how to setup an Oracle Yum server using the Oracle public yum repository. The third section reviews how to setup Linux yum clients.

Oracle Linux YUM Server Setup with the Unbreakable Linux Network

Register the Oracle Linux Host with the Oracle Unbreakable Linux Network

Step 1
Step 2
Step 3
Step 4
Step 5
Register the Linux host with ULN
Install and Setup Apache
Access ULN, enable YUM, and select RPM channels
Synchronize the Linux Yum server with ULN
Setup Yum clients
 
Before an Oracle Linux or Red Hat Enterprise Linux host can connect to the Oracle Unbreakable Linux Network, Oracle’s GPG key must be imported using the rpm command. Unbreakable Linux Network registration requires an Oracle Single Sign-on account and a valid customer service identifier (CSI). Before registering the yum server, visit the Unbreakable Linux Network, sign in, or create an Oracle Single Sign-on account, then sign in to the Unbreakable Linux Network portal. 
 
To import the Oracle’s GPG key, access the Linux yum server as root and type:
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY
 
Tip: If the RPM-GPG-KEY is not in the /etc/pki/rpm-gpg/ directory, locate the file and use the correct path to import the GPG key. For example, as root, type "find / -name RPM-GPG-KEY -print" to locate the RPM-GPG-KEY file.
 
Once the GPG key has been imported, the Linux host can be registered at the Oracle Unbreakable Linux Network from the command line or using a X Windows application. The registration process requires you to enter your Unbreakable Linux Network associated Oracle Single Sign-on user name and password and a valid Oracle Linux Support Identifier number (CSI). 
 
Linux 4 and 5 use the up2date command. To access the Unbreakable Linux Network registration screen from the command line, as root type:
# up2date  --nox --register
To access the Unbreakable Linux Network registration screen with X Windows, as root type:
# up2date --register
 
Linux 6 and 7 systems use the uln_register command. To access the Unbreakable Linux Network registration screen from the command line, as root type:
# uln_register 
 
If the host is behind a proxy, for Oracle Linux 4 and 5, as root type:
# up2date --configure
to list and edit the up2date program defaults. There are five proxy configurations that can be edited to allow access from your Linux host to the internet. The next example shows the up2date proxy configuration items with their default settings and item numbers.
  • 3. enableProxy        No
  • 4. enableProxyAuth    No
  • 11. httpProxy
  • 21. proxyPassword
  • 22. proxyUser
To edit an up2date program item, type the item number, i.e. enter 3 or 4, etc.... then type C to clear the default value or type q to quit without saving. Next, type the new value and press Enter to save the new value and to exit. If you need to enter multiple values, separate them with semicolons (;).
 
Oracle Linux 6 systems use the “--proxy” option to specify a http proxy. For example, as root type:
# uln_register --proxy=<HOST NAME>:<PORT NUMBER>
Substitute  <HOST NAME> with your proxy host name or IP address, and <PORT NUMBER> with the proxy port number, i.e. uln_register --proxy=my.proxyserver:8000
If your proxy server requires authentication, use the “--proxyUser” and “--proxyPassword” to add a username and password. For example, as root type:
# uln_register --proxy=<HOST NAME>:<PORT NUMBER> --proxyUser=<USER NAME> --proxyPassword=<PASSWORD>
Substitute  <HOST NAME> with your proxy host name or IP address, <PORT NUMBER> with the proxy port number, --proxyUser=<USER NAME> with the proxy user name, and --proxyPassword=<PASSWORD> with the proxy password, i.e. uln_register --proxy=my.proxyserver:8000 --proxyUser=myname --proxyPassword=password
 
List 4 shows the seven steps to register an Oracle Linux 6 host with the Oracle Unbreakable Linux Network:
Step 1. Assistant Welcome
Step 2. Oracle Unbreakable Linux Network Login
Step 3. Register a System Profile
Step 4. Register a System Profile Packages
Step 5. Send Profile Information to the Unbreakable Linux Network
Step 6 Review Subscription Details
Step 7 Finish Registration
 
The following example walks through the seven steps to register a Linux 6 host with the Oracle Unbreakable Linux Network.
 
Step 1. Assistant Welcome
From the Assistant Welcome screen use the Alt key to select the Next tab, once the Next tab is selected press the Enter key to proceed.  
 
Figure 1 shows the Assistant Welcome screen.
Oracle Unbreakable Linux Privacy Statement
 
Step 2. Oracle Unbreakable Linux Network Login
On the Oracle Unbreakable Linux Network Login screen, enter your  your Unbreakable Linux Network associated Oracle Single Sign-on User namePassword, and a valid Oracle CSI number. Use the Alt key to select the Next tab, and then press the Enter key to proceed.
 
Figure 2 shows the Oracle Unbreakable Linux Network Login screen.
Oracle Unbreakable Linux Network Register a User Account
 
Step 3. Register a System Profile
On the Register a System Profile screen, enter the name for the profile, i.e. the hostname, next using your keyboard spacebar select or unselect the Include the following information about hardware and network option to save or not save the hardware and network details in the Systems Profile. Use the Alt key to select the Next tab. Once the Next tab is selected, press the Enter key to proceed.
 
Note: The information gathered from the system profile step is saved in your user profile at the Oracle Unbreakable Linux Network. 
 
Figure 3 shows the Register a System Profile screen.
Oracle Unbreakable Linux Network Register a System Profile
 
Step 4. Register a System Profile Packages
On the Register a System Profile Packages screen, using your keyboard spacebar select or unselect the Include RPM packages installed on this system in my Systems Profile option to save or not save the RPM packages installed on the system in the Systems Profile. Use the Alt key to select the Next tab. Once the Next tab is selected, press the Enter key to proceed.
 
Figure 4 shows the Register a System Profile - Packages screen.
Oracle Unbreakable Linux Network Register a System Profile - Packages
 
Step 5. Send Profile Information to the Unbreakable Linux Network
From the Send Profile Information to the Unbreakable Linux Network screen, accept the defaults and use the Alt key to select the Next tab. Once the Next tab is selected, press the Enter key to proceed.
 
Figure 5 shows the Send Profile Information to the Unbreakable Linux Network screen.
Oracle Unbreakable Linux Network Send Profile Information Window
 
Step 6 Review Subscription Details
On the Review Subscription Details screen, review the subscription details, and use the Alt key to select the OK tab. Once the OK tab is selected, press the Enter key to proceed.
 
Figure 6 shows the Review Subscription Details screen.
Oracle Unbreakable Linux Network Registration Finnshed
 
Step 7 Finish Registration
On the Finish Registration screen, use the Alt key to select the Finish tab. Once the Finish tab is selected, press the Finish key to close the window.
 
Figure 7 shows the Finish Registration screen.

Oracle Unbreakable Linux Network Registration Completion Window

The Oracle Linux host has been successfully registered.
 

Install and Setup Apache

Step 1
Step 2
Step 3
Step 4
Step 5
Register the Linux host with ULN
Install and Setup Apache
Access ULN, enable YUM, and select RPM channels
Synchronize the Linux Yum server with ULN
Setup Yum clients
 
Installing Apache from the Unbreakable Linux Network is accomplished by typing the following command.
Linux 4 and 5 as root type:
# up2date -i httpd
 Linux 6 and 7 as root type:
# yum install httpd -y
 
Once Apache is installed, configure Apache to automatically start by typing:
# chkconfig httpd on
Next, start Apache by typing:
# service httpd start
 
Now, with Apache installed and ruuning, test Apache by pointing a web browser to the fully qualified domain name (FQDN) or the IP address of the Apache Web server. You should see the default Apache test page as shown in Figure 8.
 
Oracle Linux Apache Web Server
 
If you don not see the default Apache test page, check if iptables is blocking http traffic on the Apache host. Consider disabling iptables to test Apache, as root type:
# service iptables stop
 
Next, as root, create the yum repository base directory in /var/www/html by typing:
# mkdir -p /var/www/html/yum
 
Table 2 shows the minimum disk space requirements for the Oracle Linux 5 channels:
Channel NameLatest BinariesAll BinariesLatest Source & BinariesAll 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
4 GB
30 GB
4 GB
30 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 3 shows the minimum disk space requirements for the Oracle Linux 6 channels:

Channel NameLatest BinariesAll BinariesLatest Source & BinariesAll 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
5 GB
30 GB
5 GB
30 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 4 shows the minimum disk space requirements for the Oracle VM channels:

Channel NameLatest BinariesAll BinariesLatest Source & BinariesAll Source & Binaries
ovm3_<arch>_latest
250 MB
2 GB
2 GB
4 GB

 

Oracle Unbreakable Linux Network Yum Server Setup

Step 1
Step 2
Step 3
Step 4
Step 5
Register the Linux host with ULN
Install and Setup Apache
Access ULN, enable YUM, and select RPM channels
Synchronize the Linux Yum server with ULN
Setup Yum clients
 
Once your yum server has been registered, and Apache has been installed and configured, sign in to Oracle Unbreakable Linux Network and click the Systems tab to enable yum and select RPM channels. From the Systems tab click on your yum server to access its System Details page.
 
Figure 9 shows the Oracle Unbreakable Linux Network Home page with the Systems tab highlighted. 
Oracle Unbreakable Linux Network Home Page
 
From the Systems tab click your yum server to access its System Details page. From the yum servers Systems Details page click the Edit button, as shown in Figure 10.
Oracle Unbreakable Linux Network Systems Home Page
From the yum servers Edit Systems Properties page, select the Yum Server check box, enter a valid CSI number, then click the Apply Changes button, as shown in Figure 11.
Oracle Unbreakable Linux Network Systems Page Apply Changes
Next, click the Manage Subscriptions button, as shown in Figure 12.
Oracle Unbreakable Linux Network Manage Subscriptions
 
From the Manage Subscriptions page select the Add ons channel for the yum server operating system version. The Add ons channel is required to install yum server prerequisite packages. In this example Oracle Linux 6 Add ons (x86_64) was select since the example yum server is Oracle Linux 6 x86_64. Next, move all of the desired RPM channels from the Available channels window to the Subscribed channels window. The RPM channels listed in the Subscribed channels window will be downloaded to your yum server using the uln-yum-mirror script. The uln-yum-mirror package is located in the Add ons channel. Next, click the Save Subscriptions button to save the changes, as shown in Figure 13.
 
Tip: Review the Channel Legend for details about each RPM channel. 
 
Oracle Unbreakable Linux Network System Details
 
The yum server has been successfully setup using the Oracle Unbreakable Linux Network. 
 
The next step is to install the yum server prerequisite packages, i.e. yum-utils for Oracle Linux 5 and 6, uln­-yum­-proxy for Oracle Linux 5, and uln-yum-mirror for Oracle Linux 6. As root type the following command:
 
Oracle Linux 5:
# yum install --disablerepo=* --enablerepo=el5_x86_64_addons,ol5_x86_64_latest uln­-yum­-proxy yum-utils -y
Note: The above command assumes that the yum server is subscribed to the el5_x86_64_addons channel for the uln­-yum­-proxy package, and the ol5_x86_64_latest channel for the yum-utils package.
 
Oracle Linux 6:
# yum install --disablerepo=* --enablerepo=ol6_x86_64_addons,ol6_x86_64_latest uln-yum-mirror yum-utils -y
Note: The above command assumes that the yum server is subscribed to the ol6_x86_64_addons channel for the uln­-yum­-mirror package, and the ol6_x86_64_latest channel for the yum-utils​ package..
 
Tip: Using the “yum install package” command without --disablerepo=* --enablerepo= could cause the wrong RPM package to be installed. See below for more details.
 

How to Patch and Install Packages on the Oracle Linux Yum Server Operating System

Once an Oracle Unbreakable Linux Network yum server has been set-up, RPM installations and updates for the yum server operating system should be done using the --disablerepo=* and --enablerepo= options to ensure that the RPMs originate only from desired RPM channels. Patching a Linux host using the --disablerepo=* option disables all RPM channels, followed by the --enablerepo= option with a list of desired RPM repositories (separated by a single comma) instruct the yum client to only use the RPM channels listed in --enablerepo=. Oracle Unbreakable Linux Network yum servers that are patched without --disablerepo=* and --enablerepo= may install RPMs from all enabled Unbreakable Linux Network RPM channels, which could promptly corrupt the yum server' operating system.
 
To list the configured RPM channels from an Oracle Unbreakable Linux Network yum server, type yum repolist or yum repolist -v for verbose. The next example shows the results from yum repolist on an Oracle Linux 6 Unbreakable Linux Network yum server.
 
# yum repolist
Loaded plugins: rhnplugin, security
This system is receiving updates from ULN.
repo idrepo namestatus
el5_x86_64_addonsEnterprise Linux 5 Add ons(x86_64)231
el5_x86_64_latestEnterprise Linux 5 Latest (x86_64)21,976
epelExtra Packages for Enterprise Linux 6 - x86_648,615
ol6_x86_64_addonsOracle Linux 6 Add ons (x86_64)82
ol6_x86_64_latestOracle Linux 6 Latest (x86_64)21,156
ovm3_x86_64_latestOracle VM 3 latest825
repolist: 52,885  
 
If the “yum update” command was used on the example Oracle Unbreakable Linux Network yum server, the RPM packages from all of the above listed RPM channels would be used for the update, which could corrupt the operating system.
 
The next example shows how to update the above example Oracle Linux 6 hosts only using the ol6_x86_64_latest and el5_x86_64_addons RPM channels.
# yum update --disablerepo=* --enablerepo=ol6_x86_64_latest -y
 
The next example shows how to update the above example Oracle Linux 6 hosts only using the ol6_x86_64_latest RPM channel.
# yum update --disablerepo=* --enablerepo=ol6_x86_64_latest, ol6_x86_64_addons -y
 
Tip: To list the RPM channels from an Oracle Unbreakable Linux Network yum server, type “yum repolist”. Select the desired RPM channels from the“yum repolist” output, and enter each desired RPM channel after --enablerepo=, i.e. --enablerepo=ol6_x86_64_latest, ol6_x86_64_addons to install packages from the ol6_x86_64_latest, and the ol6_x86_64_addons RPM channels.
 
To search for and install the bind RPM only from the ol6_x86_64_latest RPM channel, use the following --disablerepo=* and --enablerepo= options.
 
To search for the bind RPM from the ol6_x86_64_latest RPM channel:
yum list bind --disablerepo=* --enablerepo=ol6_x86_64_latest
 
To install the bind RPM ol6_x86_64_latest RPM channel:
yum install bind --disablerepo=* --enablerepo=ol6_x86_64_latest
 
An other option is to edit the yum server's /etc/yum/pluginconf.d/rhnplugin.conf file to configure the yum client to only use the appropriate yum server operating system channels. To disable Oracle Unbreakable Linux Network channels add the following stanza in /etc/yum/pluginconf.d/rhnplugin.conf for each channel:
[<repo id>]
enabled=0
 
For example, to disable the channels listed in the above example, add the following stanzas:
[el5_x86_64_latest]
enabled=0
 
[el5_x86_64_addons]
enabled=0
 
[epel]
enabled=0
 
[ovm3_x86_64_latest]
enabled=0
 
Note: Editing the /etc/yum/pluginconf.d/rhnplugin.conf file disables the ULN channels from being accessed by the yum client, but will not affect uln-yum-mirror functionality. The uln-yum-mirror is covered in the next section. 
 

Synchronize the Linux Yum Server with Oracle Unbreakable Linux Network

Step 1
Step 2
Step 3
Step 4
Step 5
Register the Linux host with ULN
Install and Setup Apache
Access ULN, enable YUM, and select RPM channels
Synchronize the Linux Yum server with ULN
Setup Yum clients
 
Local yum repositories are synchronized to the Unbreakable Linux Network using the uln-yum-mirror script.
 
Next, install the yum server prerequisite packages, i.e. yum-utils for Oracle Linux 5 and 6, uln­-yum­-proxy for Oracle Linux 5, and uln-yum-mirror for Oracle Linux 6. As root type the following command:
Oracle Linux 5:
# yum install --disablerepo=* --enablerepo=el5_x86_64_addons,ol5_x86_64_latest uln­-yum­-proxy yum-utils -y
Note: The above command assumes that the yum server is subscribed to the el5_x86_64_addons channel for the uln­-yum­-proxy package, and the ol5_x86_64_latest channel for the yum-utils package.
 
Oracle Linux 6:
# yum install --disablerepo=* --enablerepo=ol6_x86_64_addons,ol6_x86_64_latest uln-yum-mirror yum-utils -y
Note: The above command assumes that the yum server is subscribed to the ol6_x86_64_addons channel for the uln­-yum­-mirror package, and the ol6_x86_64_latest channel for the yum-utils​ package.
 
Installing the uln-yum-mirror package installs the /usr/bin/uln-yum-mirror script as well as configures a daily cronjob to synchronize your yum repositories. The uln-yum-mirror script cofigurations can edited to meet your synchronization requirements by editing the /etc/sysconfig/uln-yum-mirror file. The default cronjob is set to run once a day via cron.daily from the uln-yum-mirror script located in the /etc/cron.daily directory. The cron.daily job will run once a day at 3:05AM. The cronjob can be edited or disabled by editing the /etc/sysconfig/uln-yum-mirror file and setting CRON_ENABLED to 0. The uln-yum-mirror script can be manually run by typing:
# /usr/bin/uln-yum-mirror &
 
Note: The initial synchronization job may take days to complete, depending on the number of enabled channels, and your network bandwidth.
 
The uln-yum-mirror script can also be moved to the /etc/cron.weekly or /rtc/cron.monthly directories to change the schedule from cron.daily to cron.weekly or cron.monthly. 
  • cron.daily will run once a day at 3:05AM.
  • cron.weekly will run once a week at 3:25AM.
  • cron.monthly will run once a month at 3:45AM.
For example, to move the default cron.daily cronjob to cron.monthly, as root, type the following command:
# mv /etc/cron.daily/uln-yum-mirror /etc/cron.monthly/
 
The following configuration options are available in the /etc/sysconfig/uln-yum-mirror configuration file:
 
SRC = [ 0 | 1 ]
The SRC parameter determines if the script downloads the associated .src.rpm files. The default is 0 which disables downloading .src.rpm files, changing the value to 1 includes source packages.
 
ALL_PKGS = [ 0 | 1 ]
The ALL_PKGS parameter determines if the script downloads all available packages or just the latest packages. The default is 1 which downloads all available packages, changing the value to 0 only downloads the latest version of each package.
 
CRON_ENABLED = [ 0 | 1 ]
The CRON_ENABLED parameter determines if the daily anacron job is enabled. If this parameter is set to 0, the uln-yum-mirror script is disabled and will need to be manually run.
 
HARDLINK_RPMS
The HARDLINK_RPMS parameter specifies if hardlinkpy runs after channel sychronization. hardlinkpy will reduce repository disk space by hardlinking identical packages.
 
LOG_OUTPUT
The LOG_OUTPUT parameter specifies if the output of the automatic cronjob is logged to /var/log/uln-yum-mirror.log.
 
REP_BASE
REPO_FILE_DIR
YUM_GLOBAL_CACHE

These parameters specify the paths of the synchronized channels and yum cache directory. Only change these settings if you need to edit the web server.
 
REP_ENG
REP_EL
REP_OL
REP_OVM
REP_UNK

These parameters determine the repository name for each of the channels. The names can be edited for each of the channel groups. The REP_ENG parameter is for Oracle Engineered Systems, e.g. Exadata and Exalogic.
 
To view the yum server's current cronjob, as root type:
# crontab -l
To edit the cronjob as root type:
# crontab -e
 
Crontab Syntax:
# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
 

Oracle Linux Yum Server Setup using the Oracle Pubic Repository

Install and Setup Apache

Step 1
Step 2
Step 3
Install and configure Apache
Synchronize the Linux Yum server with the Oracle public yum repository
Setup Yum clients
 
Installing Apache from the Oracle public yum repository is accomplished by typing the following commands as root.
Linux 4 and 5:
# cd /etc/yum.repos.d/
# yum install httpd -y
Linux 6
# cd /etc/yum.repos.d/
# yum install httpd
 
Once Apache is installed, configure Apache to automatically start by typing:
# chkconfig httpd on
Next, start Apache by typing:
# service httpd start
 
Now, with Apache installed and ruuning, test Apache by pointing a web browser to the fully qualified domain name (FQDN) or the IP address of the Apache Web server. You should see the default Apache test page as shown in Figure 14.
 
Oracle Linux Apache Web Server
 

If you don not see the default Apache test page, check if iptables is blocking http traffic on the Apache host. Consider disabling iptables to test Apache, as root type:
# service iptables stop

Next, as root, create the yum repository base directory in /var/www/html by typing:
# mkdir -p /var/www/html/yum

Table 5 shows the approximate disk space requirements for Oracle's public Linux and Oracle VM RPM repositories:

RPM Channel
Binaries
el*/ol*_latest
13-19G
el*/ol*_addons
600M
el*/ol*_base
3G
ovm3_latest500M
 

Synchronize the Oracle linux Yum Server with the Oracle Public Yum Repository

Step 1
Step 2
Step 3
Install and Setup Apache
Synchronize the Linux Yum server with the Oracle public yum repository
Setup Yum clients
 
Local yum repositories are setup using Oracle's public .repo files, the reposync and createrepo commands along with a cron job to automatically synchronize the yum repository to the Oracle public yum repository.
 
Tip: The reposync and createrepo commands are part of the yum-utils RPM package. If your Oracle Linux Yum server does not have reposync and/or createrepo, install the yum-utils RPM by typing the following command as root:
# yum install yum-utils -y
 
The first step is to download a repo file for each Linux version that your yum server will support. To download the repo files, as root type the following commands:
# cd /etc/yum.repos.d/
 
For Oracle VM up to Release 3.2 create a repo file on the yum server named "/etc/yum.repos.d/public-yum-ovm3.repo" with the following contents:
[ovm3_latest]
name=Oracle VM Server 3 Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleVM/OVM3/latest/x86_64/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
gpgcheck=1
enabled=1
 
The next example shows how to dowload the ovm3_latest RPMs.
# reposync -r ovm3_latest -p /var/www/html/yum/public/
 
For Oracle VM Release 3.3 and above, create a repo file on the yum server named "/etc/yum.repos.d/public-yum-ovm3x.repo" with the following contents:
[ovm3x_latest]
name=Oracle VM Server 3x Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleVM/OVM3/3x_latest/x86_64/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1
 
The next example shows how to dowload the ovm3x_latest RPMs.
# reposync -r ovm3x_latest -p /var/www/html/yum/public/
 
Note: As needed substitute the path, i.e. -p /var/www/html/yum/public/ with your desired path.
 
The reposync command -r switch is used to indicate which repository in the repo file to download. The reposync command -p switch is used to indicate which directory is used for the local repository. Consult resosync's man pages for further deatails by typing "man reposync". 
 
Next, using your favorite text editor, edit the repo files and enable each desired RPM repository by changing enabled=0 to enabled=1. To enable a repository change enabled=0 to enabled=1. Note that enabled=0 disableds an RPM repository and enabled=1 enables an RPM repository.
 
Next, check for and if necessary install the yum-utils and createrepo prerequisite RPM packages. As root, type the following commands to check for and if necessary install yum-utils and createrepo.
# rpm -q yum-utils createrepo
yum-utils-1.1.16-21.el5
createrepo-0.4.11-3.el5
 
The above example shows a host with the two prerequisite RPM packages. If your host does not have one or both of the prerequisite RPM packages, install the RPMs as shown in the next example.
 
Note: The yum server must have a .repo file for the Linux OS version to be able to install RPMs from the Oracle public repository, i.e. if the yum server is Oracle Linux 5, the public-yum-el5.repo file needs to be in the /etc/yum.repos.d/ directoty to install RPM packages.
 
# yum install yum-utils
# yum install createrepo
 
Next, confirm the configured RPM repositories by typing the following command as root:
# yum repolist -v
If the RPM repositories are listed, you can proceed. If you see errors check the repo file syntax, and/or the Proxy settings. 
 
If the host is behind a proxy, for Oracle Linux 4 and 5, as root type:
# up2date --configure
to list and edit the up2date program defaults. There are five proxy configurations that can be edited to allow access from your Linux host to the internet. The next example shows the up2date proxy configuration items with their default settings and item numbers.
  • 3. enableProxy        No
  • 4. enableProxyAuth    No
  • 11. httpProxy
  • 21. proxyPassword
  • 22. proxyUser
To edit an up2date program item, type the item number, i.e. enter 3 or 4, etc.... then type C to clear the default value or type q to quit without saving. Next, type the new value and press Enter to save the new value and to exit. If you need to enter multiple values, separate them with semicolons (;).
 
Oracle Linux 6 systems use the “--proxy” option to specify a http proxy. For example, as root type:
# uln_register --proxy=<HOST NAME>:<PORT NUMBER>
Substitute  <HOST NAME> with your proxy host name or IP address, and <PORT NUMBER> with the proxy port number, i.e. uln_register --proxy=my.proxyserver:8000
If your proxy server requires authentication, use the “--proxyUser” and “--proxyPassword” to add a username and password. For example, as root type:
# uln_register --proxy=<HOST NAME>:<PORT NUMBER> --proxyUser=<USER NAME> --proxyPassword=<PASSWORD>
Substitute  <HOST NAME> with your proxy host name or IP address, <PORT NUMBER> with the proxy port number, --proxyUser=<USER NAME> with the proxy user name, and --proxyPassword=<PASSWORD> with the proxy password, i.e. uln_register --proxy=my.proxyserver:8000 --proxyUser=myname --proxyPassword=password
 
Next, download the RPMs for the first time using the reposync command. The next example shows how to dowload the el5_latest RPMs.
# reposync -r el5_latest -p /var/www/html/yum/public/
 
The next example shows how to dowload the ol6_latest RPMs to the /var/www/html/yum/public/ directory.
# reposync -r ol6_latest -p /var/www/html/yum/public/
 
The next example shows how to dowload the ovm3_latest RPMs.
# reposync -r ovm3_latest -p /var/www/html/yum/public/
 
The next example shows how to dowload the ovm3x_latest RPMs.
# reposync -r ovm3x_latest -p /var/www/html/yum/public/
 
Note: As needed substitute the path, i.e. -p /var/www/html/yum/public/ with your desired path.
 
The reposync command -r switch is used to indicate which repository in the repo file to download. The reposync command -p switch is used to indicate which directory is used for the local repository. Consult resosync's man pages for further deatails by typing "man reposync". 
 
Once the repositories have been populated, create a script to update the repositories and add it to cron to automatically synchronize the local yum RPM repository to Oracle.
 
The next example shows the contents of a script named update-oracle-repo.log located in the /usr/local/bin/ directory that updates the Oracle Linux 5 and 6 latest repositories.
# cat /usr/local/bin/update-oracle-repo.log
#!/bin/bash
reposync -r ol6_latest -p /var/www/html/yum/public/
createrepo /var/www/html/yum/public/el5_latest/getPackage/
reposync -r el5_latest -p /var/www/html/yum/public/
createrepo /var/www/html/yum/public/ol6_latest/getPackage/
 
Next, make the script executable by typing:
# chmod +x /usr/local/bin/update-oracle-repo.log
 
As root or any other user with access to the script, type "chrontab -e" to edit your crontab file, or create a new crontab file if one does not already exist. The next example shows how to create a crontab file as root that will run the update-oracle-repo.log script at midnight every weekday and log the results to /var/log/update-oracle-repo-result.log.
 
# crontab -e
15 0 * * * /usr/local/bin/update-repository.sh > /var/log/update-oracle-repo-result.log
 
To view the yum server's current cronjob:
# crontab -l
To edit the cronjob as root type:
# crontab -e
 
Crontab Syntax:
# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
 

Oracle Linux Yum Client Setup

To make a yum Server available to Linux or Oracle VM hosts create a .repo file that points to the yum server. On a Linux or Oracle VM host, as root create a file in /etc/yum.repos.d/ directory with the .repo extention, i.e. my-ol5-local-yum-server.repo. The .repo file can have any name as long as it has a .repo extention. In the .repo file add the desired RPM channel settings.
 
A yum .repo configuration file can contain one or more sections to define RPM repositories.

Table 4 lists the repository directives.
Directive DescriptionExplanation
baseurlThe location of the RPM repository, i.e. file://, ftp://, or http://. This directive is required
enabledIf set to 1, enables the RPM repository.
nameA descriptive name for the RPM repository. This directive is required
 
Tip: Consult the yum.conf(5) man page for additional details.
 
The next example shows a .repo file named my-ol5-local-yum-server.repo that points a Linux host to use the el5_latest RPM channel on a Yum server named "<yum_server>". Replace <yum_server> with the IP address or fully qualified domain name (FQDN) of your Yum server.
 
# vi /etc/yum.repos.d/my-ol5-local-yum-server.repo
[el5_latest]
name=Oracle Linux $releasever - $basearch - latest
baseurl=http://<yum_server>/var/www/html/yum/public/el5_latest/getPackage/
gpgcheck=1
enabled=1
 
The next example shows a .repo file named my-ovm3-local-yum-server.repo that points a Oracle VM host to use the ovm3_latest RPM channel on a Yum server named "<yum_server>". Replace <yum_server> with the IP address or fully qualified domain name (FQDN) of your Yum server.
 
# vi /etc/yum.repos.d/my-ovm3-local-yum-server.repo
[ovm3_latest]
name=Oracle VM Server 3 Latest ($basearch)
baseurl=http://<yum_server>/var/www/html/yum/public/ovm_latest/getPackage/
gpgcheck=1
enabled=1
 
The following list shows all of the Oracle public RPM channels that can be added to a Linux host's .repo file. Replace public-yum.oracle.com with the IP address or fully qualified domain name (FQDN) of your Yum server.

Oracle Linux 5 .repo File Entries:

[el5_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[el5_ga_base]
name=Oracle Linux $releasever GA installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/0/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_u1_base]
name=Enterprise Linux $releasever Update 1 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/1/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_u2_base]
name=Enterprise Linux $releasever Update 2 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/2/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_u3_base]
name=Enterprise Linux $releasever Update 3 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/3/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_u4_base]
name=Enterprise Linux $releasever Update 4 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/4/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_u5_base]
name=Enterprise Linux $releasever Update 5 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/5/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u5_base]
name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/5/base/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u6_base]
name=Oracle Linux $releasever Update 6 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/6/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u7_base]
name=Oracle Linux $releasever Update 7 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u8_base]
name=Oracle Linux $releasever Update 8 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/8/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u9_base]
name=Oracle Linux $releasever Update 9 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/9/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_u10_base]
name=Oracle Linux $releasever Update 10 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/10/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_addons]
name=Enterprise Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_oracle_addons]
name=Oracle Software addons for Enterprise Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/oracle_addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[el5_unsupported]
name=Productivity Applications for Enterprise Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/unsupported/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol5_spacewalk20_client]
name=Spacewalk Client 2.0 for Oracle Linux 5 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/spacewalk20/client/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

Oracle Linux 6 .repo File Entries:

[ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_ga_base]
name=Oracle Linux $releasever GA installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/0/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u1_base]
name=Oracle Linux $releasever Update 1 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/1/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u2_base]
name=Oracle Linux $releasever Update 2 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/2/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u3_base]
name=Oracle Linux $releasever Update 3 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/3/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u4_base]
name=Oracle Linux $releasever Update 4 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/4/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u5_base]
name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/5/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_UEKR3_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEKR3/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_playground_latest]
name=Latest mainline stable kernel for Oracle Linux 6 ($basearch) - Unsupported
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/playground/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_MySQL]
name=MySQL 5.5 for Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/MySQL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_gdm_multiseat]
name=Oracle Linux 6 GDM Multiseat ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/gdm_multiseat/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_ofed_UEK]
name=OFED supporting tool packages for Unbreakable Enterprise Kernel on Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/ofed_UEK/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_MySQL56]
name=MySQL 5.6 for Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/MySQL56/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_spacewalk20_server]
name=Spacewalk Server 2.0 for Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/spacewalk20/server/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_spacewalk20_client]
name=Spacewalk Client 2.0 for Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/spacewalk20/client/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

 

Yum Command Examples – Repository Listing, Install, Uninstall, & Update RPM Packages

Installing, removing, and updating RPM packages is a fundamental Linux lifecycle operation. This section of the Oracle Cloud Cookbook introduces the most frequently used yum commands to query RPM repositories, install, uninstall, & update RPM packages.
 
Linux distributions have one or more package managers. The yum package manager is the default RPM package manager for Red Hat distributions such as Oracle Linux and CentOS. Yum stands for Yellowdog Updater Modified. Yum is a client command for updating RPMs from RPM repositories on yum servers. Yum servers maintain up-to-date RPM header and metadata that point yum clients to RPMs and their RPM dependencies.
 
The yum command requires an argument to specify the action to take. The most commonly used yum commands are:
  • install
  • remove
  • update
  • list
  • search

The install and remove commands work as expected, they install or remove the listed RPM packages. The install, remove and update commands determine what other packages must be installed or removed (dependencies) and presents the details for confirmation. Wildcards can be used in the package names to specify a group of related packages. For example:

# yum install 'foo'
# yum remove 'foo'
# yum update 'foo'
# yum install 'foo fie fo fum'
# yum remove 'foo fie fo fum'
# yum update 'foo fie fo fum'

Yum Repository Listing and Maintenance

The repolist command with its subcommands queries the RPM repository entries in a yum client's .repo files.
 
The next example shows the output from the "yum repolist enabled" command. The "yum repolist enabled" command lists a yum client's enabled repositories with the status and the number of RPMs.
# yum repolist enabled
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
repo id                                             repo name                                                                               status
el5_latest                                       Oracle Linux 5 Latest (x86_64)                                                 4,221
epel                                                Extra Packages for Enterprise Linux 5 - x86_64                       7,194
repolist: 11,415
 
The next example shows the output from the "yum repolist disabled" command. The "yum repolist disabled" command lists a yum client's disabled repositories.
# yum repolist disabled
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
repo id                                             repo name                                                                                     
epel-debuginfo                                Extra Packages for Enterprise Linux 5 - x86_64 - Debug                                        
epel-source                                     Extra Packages for Enterprise Linux 5 - x86_64 - Source                                       
epel-testing                                     Extra Packages for Enterprise Linux 5 - Testing - x86_64                                      
epel-testing-debuginfo                   Extra Packages for Enterprise Linux 5 - Testing - x86_64 - Debug                              
epel-testing-source                         Extra Packages for Enterprise Linux 5 - Testing - x86_64 - Source                             
repolist: 0
 
The next example shows the output from the "yum repolist all" command. The "yum repolist all" command lists a yum client's enabled and disabled repositories with the status and the number of RPMs.
# yum repolist all
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
repo id                                     repo name                                                                                             status
el5_latest                             Oracle Linux 5 Latest (x86_64)                                                                enabled: 4,221
epel                                      Extra Packages for Enterprise Linux 5 - x86_64                                      enabled: 7,194
epel-debuginfo                     Extra Packages for Enterprise Linux 5 - x86_64 - Debug                        disabled
epel-source                          Extra Packages for Enterprise Linux 5 - x86_64 - Source                        disabled
epel-testing                          Extra Packages for Enterprise Linux 5 - Testing - x86_64                        disabled
epel-testing-debuginfo         Extra Packages for Enterprise Linux 5 - Testing - x86_64 - Debug           disabled
epel-testing-source              Extra Packages for Enterprise Linux 5 - Testing - x86_64 - Source          disabled
repolist: 11,415
 
The "yum repolist -v" command verbosly lists all enabled repositories. The yum repolist -v command is useful to list the details from all configured repositories. The next example shows the output from the "yum repolist -v" command.
# yum repolist -v
Loading "rhnplugin" plugin
Loading "security" plugin
Config time: 0.048
This system is not registered with ULN.
ULN support will be disabled.
Yum Version: 3.2.22
Setting up Package Sacks
pkgsack time: 0.039
Repo-id      : el5_latest
Repo-name    : Oracle Linux 5 Latest (x86_64)
Repo-updated : Fri Oct 26 10:30:15 2012
Repo-pkgs    : 4,221
Repo-size    : 5.3 G
Repo-baseurl : http://192.168.4.13/yum/OracleLinux/OL5/latest/x86_64/
Repo-expire  : 3,600 second(s) (last: Fri Oct 26 16:47:06 2012)

Repo-id      : epel
Repo-name    : Extra Packages for Enterprise Linux 5 - x86_64
Repo-revision: 1351273445
Repo-tags    : binary-x86_64
Repo-updated : Fri Oct 26 10:46:18 2012
Repo-pkgs    : 7,194
Repo-size    : 5.4 G
Repo-mirrors : http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64
Repo-expire  : 3,600 second(s) (last: Fri Oct 26 16:47:13 2012)

repolist: 11,415
 
Clean the yum cache using yum clean
The yum clean command with its subcommands (clean [ headers | packages | metadata | dbcache | plugins | expire-cache | all) is used to clean the yum cache headers, packages, metadata, dbcache, plugins and expire-cache. The yum clean command with its subcommands is useful to make sure the yum cache is clean. The next example shows how to clean the yum cache.
# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
 
Rebuild the yum cache using yum makecache
The yum makecache command downloads the metadata for all enabled yum repositories. The yum makecache command is useful to make sure the cache is current.
# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
el5_latest                                            | 1.9 kB     00:00
el5_latest/filelists_db                          | 7.1 MB     00:00
el5_latest/other_db                             |  20 MB     00:01
el5_latest/primary_db                         | 6.1 MB     00:00
epel                                                     | 3.7 kB     00:00
epel/filelists_db                                    | 5.5 MB     00:06
epel/updateinfo                                    | 473 kB     00:01
epel/other_db                                       | 2.3 MB     00:03
epel/group_gz                                      | 168 kB     00:00
epel/primary_db                                   | 3.8 MB     00:05
Metadata Cache Created
 

Listing RPM Packages & RPM Groups

List all available RPM packages using yum list
The yum list command without any options lists all of the packages in all configured repositories and all of the installed packages on a Linux host. Note that yum list all and yum list generate the same output. The next example shows how to list all the available packages.
# yum list | less
 
List all the installed RPM packages using yum list installed
The yum list installed command lists all the installed packages on the system. The yum list installed command is equivalent to rpm -qa. The next example shows how to list all the installed packages on the system.
# yum list installed | less
 
Check if a particular RPM package is installed using yum list
The next example shows how to confirm if a package, i.e. ntp, is already installed. Substitute the RPM package name ntp with the name of the RPM package you would like to query.
# yum list ntp
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Installed Packages
ntp.x86_64                     4.2.2p1-15.el5_7.1                      installed
 
List available software groups with yum grouplist
Repositories offer package groups to manage related packages as sets. Many 3rd party repositories add packages to these groups and provide their packages as additional groups. The next example shows how to list all the available RPM package groups.
# yum grouplist
 
List which RPM package a file belong to with yum provides
The "yum provides" command lists which package a file belongs to. For example, to list the name of the package that has the /etc/ntp.conf file, type the following:
# yum provides /etc/ntp.conf
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
ntp-4.2.2p1-15.el5_7.1.x86_64 : Synchronizes system time using the Network Time Protocol (NTP).
Repo        : el5_latest
Matched from:
Filename    : /etc/ntp.conf

ntp-4.2.2p1-15.el5_7.1.x86_64 : Synchronizes system time using the Network Time Protocol (NTP).
Repo        : installed
Matched from:
Other       : Provides-match: /etc/ntp.conf
 

Installing, Removing, Updating and Searching RPM Packages & RPM Groups

The yum install <packagename> command installs <packagename> including all of the required dependencies. The next example shows how to install the ntp package. Substitute ntp with the package you would like to install.
# yum install ntp
 
It is possible to install multiple packages by adding the package names to the end of the line.
# yum install foo fie fo fum
 
The yum remove <packagename> command removes <packagename> including all of the required dependencies. The next example shows how to remove the ntp package. Substitute ntp with the package you would like to remove.
# yum remove ntp
 
The yum update <packagename> command updates <packagename> including all of the required dependencies. The next example shows how to update the ntp package. Substitute ntp with the package you would like to update.
# yum update ntp
 
The yum update command updates all of the RPM packages that need to be updated, including all of the required dependencies. The next example shows how to update all of the packages that need to be updated.
# yum update
 
TIp: The -y option can be used to answer yes to all questions. For example, yum update -y would install all packages without having to type "yes".
 
The yum search <search term> command searches the enables repositories for the search term. The next example shows how to search for the ntp package. Substitute ntp with the package you would like to find.
# yum search ntp
 
Tip: Wildcards can be used with the search directive, such as * (match anything) and ? (match any single character).
 
The yum groupinstall 'the group's name enclosed in single quotes' command is used to install package groups. The following example shows how to install, update and remove a package group.
# yum groupinstall 'FTP Server'
# yum groupupdate 'FTP Server'
# yum groupremove 'FTP Server'
 
If a server crashes during a yum operation, or if a yum command hangs, the yum rpm database can get corrupted. A corrupt yum rpm database can cause yum commands to print interesting errors on the console, or to just hang. The resolution is to rebuild the yum rpm database.
 
As root type the following commands:
The next command deleted the rpm database:
# rm -f /var/lib/rpm/__db*
The next command rebuilds the rpm database:
# rpm --rebuilddb
The next command clean all cached files from any enabled repository:
# yum clean all
 
Document Created: 07/16/12
Last Update: 12/13/14
 
Copyright © 2015 Mokum Solutions, Inc. All rights reserved.
Distribution of the Oracle Cloud Cookbook or derivative of the work in any form is prohibited unless prior permission is obtained from the copyright holder.