Yellowdog Updater, Modified (YUM) is an open source command line package management utility for RPM packages. It is a tool for installing, removing, querying, and managing RPM packages. YUM automatically determines dependencies for the packages getting updated or installed and thus fetches the dependent packages and installs them with the requested packages. It works with an existing software repository that contains RPM packages. The YUM repository can be accessed locally or over a network.
This tutorial explains the different methods to install YUM, create local YUM repositories of AIX Toolbox RPM packages, and configure YUM. These methods talk about the best solution to use in cases where an AIX system may or may not have access to the Internet.
This tutorial is best understood if users have some of the basic skills on:
Red Hat Package Manager (RPM) and basic RPM commands:
YUM and YUM repositories:
Apache HTTP proxy configuration:
It takes around 30 minutes for users to read and understand this tutorial.
You can configure YUM either by using the yum.sh script or the YUM README file.
Using yum.sh script
This is the preferred method and is useful if users have access to the Internet and can connect to the IBM public FTP server public.dhe.ibm.com directly. The yum.sh script doesn’t work with a proxy setup.
Download and run the yum.sh script from the root user. This script performs the following tasks:
Downloads and updates to the latest version of rpm.rte (which is prerequisite for YUM).
Downloads, extracts, and installs the required RPM packages from latest yum_bundle.tar file.
Using YUM README file
This method is used if the AIX system doesn’t have access to the Internet to connect to the IBM public FTP server.
Follow the two manual steps mentioned in README-yum available on AIX Toolbox. After installing YUM manually, the AIX system needs to have access to the Toolbox repositories. To access Toolbox repositories, one of two methods mentioned below can be used.
- Using a local YUM repository. Refer Creating a local YUM repository section.
- Using a proxy setup. Refer YUM proxy configuration section.
Creating a local YUM repository
To setup a local YUM repository, one of the systems must have access to the Internet and this system serves as the repository to other AIX systems.
For better clarity, we call the system with Internet access where the local YUM repository is being created as the Repo server and other AIX systems that use its repository as the AIX Repo clients.
The Repo server must be an RPM-based system such as AIX or Linux®. The HTTP server must be running on the Repo server and the directory where repositories are created should be accessible by the AIX Repo clients using HTTP so that they can connect to it using YUM and retrieve the RPM packages.
Refer to the following steps (1-7) to create and use the local YUM repository.
Run steps 1-6 on the Repo server and step 7 on the AIX Repo clients.
Install yum-utils and createrepo packages.
yum install yum-utils yum install createrepo
Create the AIX Toolbox repository entry
Repo server, create AIX Toolbox repository entries in the repository file as shown below.
On the Linux
Repo server, you need to create the following repository file: /etc/yum.repos.d/AIX-Toolbox.repo
On the AIX
Repo server, the default YUM configuration file /opt/freeware/etc/yum/yum.conf is installed with YUM. Some repository entries would have been present already, but make sure you have following entries.
[AIX_Toolbox] name=AIX generic repository baseurl= http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/ [AIX_Toolbox_noarch] name=AIX noarch repository baseurl= http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/noarch/ [AIX_Toolbox_61] name=AIX 6.1 specific repository baseurl= http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-6.1/ [AIX_Toolbox_71] name=AIX 7.1 specific repository baseurl= http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/ [AIX_Toolbox_72] name=AIX 7.2 specific repository baseurl= http://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/
Verify whether the AIX repositories are enabled.
# yum repolist AIX_Toolbox | 2.9 kB 00:00:00 AIX_Toolbox_61 | 2.9 kB 00:00:00 AIX_Toolbox_71 | 2.9 kB 00:00:00 AIX_Toolbox_72 | 2.9 kB 00:00:00 AIX_Toolbox_noarch | 2.9 kB 00:00:00 (1/4): AIX_Toolbox_61/primary_db | 8.7 kB 00:00:00 (2/4): AIX_Toolbox_72/primary_db | 8.0 kB 00:00:00 (3/4): AIX_Toolbox_noarch/primary_db | 39 kB 00:00:00 (4/4): AIX_Toolbox/primary_db | 266 kB 00:00:00 repo id repo name status AIX_Toolbox AIX generic repository 346 AIX_Toolbox_61 AIX 6.1 specific repository 12 AIX_Toolbox_71 AIX 7.1 specific repository 10 AIX_Toolbox_72 AIX 7.2 specific repository 10 AIX_Toolbox_noarch AIX noarch repository 79 ……... repolist: 9,793
Run reposync to sync all AIX Toolbox repository to the Linux system.
Here, we need to provide the repository ID using the
reposyncwill try to sync all enabled repositories.
-pis the path where we want rpm files to be copied.
-aspecifies an architecture.
# reposync -p <target_path> -r AIX_Toolbox -a ppc # reposync -p <target_path> -r AIX_Toolbox_61 -a ppc # reposync -p <target_path> -r AIX_Toolbox_71 -a ppc # reposync -p <target_path> -r AIX_Toolbox_72 -a ppc # reposync -p <target_path> -r AIX_Toolbox_noarch
Verify whether all the repositories are synchronized.
# ls <target_path>/ AIX_Toolbox AIX_Toolbox_61 AIX_Toolbox_71 AIX_Toolbox_72 AIX_Toolbox_noarch # ls <target_path>/AIX_Toolbox
Note: In this example, the above commands should show all the AIX Toolbox repository RPM package directories.
Run createrepo to create the YUM repository for all the downloaded packages.
# createrepo <target_path>/AIX_Toolbox # createrepo <target_path>/AIX_Toolbox_61 # createrepo <target_path>/AIX_Toolbox_71 # createrepo <target_path>/AIX_Toolbox_72 # createrepo <target_path>/AIX_Toolbox_noarch
Edit the /opt/freeware/etc/yum/yum.conf file on the AIX system.
Edit this file to add and enable the newly created repository on the Linux system.
For the first time,
reposyncsynchronizes all available RPM packages in the YUM repository, including the older RPM packages enabled through YUM. So, next time when package update happens, and we run
reposyncit copies only the updated RPM package, but the older RPM package will still be present in the system, and when we run
createrepo, we will have the older as well as the newer RPM packages with the YUM repository. This will happen with sync as well.
reposynccopies the RPMs from where we have repodata and doesn’t copy any repodata files, but only the RPMs with its directory structure. Repository structure will not be exactly the same as AIX Toolbox and users must edit the yum.conf file to point to the correct path.
For example, For AIX Toolbox we have:
reposync, it copies RPMs as follows:
# ls <target_path>/AIX_Toolbox a2ps expat .........
So, after running
createrepo on the Linux system, the repository URL in AIX should
be something as:
YUM proxy configuration
First, you need to set up YUM manually by following the two manual steps shown in the
README-yum file. Set up the HTTP or HTTPS proxy server and allow proxy connections from the AIX
Repo clients to the proxy server.
Now, either add the proxy entry in the /opt/freeware/etc/yum/yum.conf file as:
proxy=http://<user>:<passwd>@<proxy server hostname>:<port number>
Or, export the
http_proxy environment variable as:
export http_proxy=http://<user>:<passwd>@<proxy server hostname>:<port number>
Here is the snippet of the yum.conf file with proxy entry.
[main] cachedir=/var/cache/yum keepcache=1 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 proxy=http://<proxy server hostname>:<port number> [AIX_Toolbox] name=AIX generic repository baseurl=http://public.dhe.ibm.com/aix/freeSoftware/ aixtoolbox/RPMS/ppc/ enabled=1 gpgcheck=0
It is important to understand how enterprise wants to create or use the existing YUM repositories based on the kind of infrastructures they have.
This depends on the security standards defined by an individual organization. If standards allow to access public networks, then it is best to use AIX Toolbox repositories. Otherwise, having one single server to connect to a public network which serve the YUM repositories to private systems is the preferred method.
There are ways to setup YUM from ISO image too.