This post will describe the installation of yum on AIX and some problems you can have when installing it on systems which have rpms from other sources already installed.

disclaimer

You need to be careful when switching to IBM’s RPM packages if you are using a lot of different rpms from other sources on your systems. To switch to yum, you will need to replace some low level packages like readline or glib2 which are used by a lot of applications, so it can break things. It’s better to install it when you have few simple packages like bash, screen or other small tools or if you plan to replace them with the IBM version. IBM added a lot of packages lately(like ansible :) ) so I think it’s worth it.

rpm upgrade

The first step is to upgrade the bff rpm runtime package. You can download the new rpm.rte package here: https://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/INSTALLP/ppc/rpm.rte.4.9.1.3

The installation of the new rpm version is done with installp. It’s a BFF package.

installp -acgXYd rpm.rte.4.9.1.3 rpm.rte

Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
rpm.rte                     4.9.1.3         USR         APPLY       SUCCESS
rpm.rte                     4.9.1.3         ROOT        APPLY       SUCCESS

A thing interesting to know is that the installation overwrite some rpm packages. You can see it during the rpm.rte package installation process messages.

Warning: the contents of the following RPM packages will be overwritten.
If these packages did not come from the AIX Toolbox for Linux Applications,
it may be necessary to reinstall them.

bzip2-1.0.6-1
gettext-0.17-1
info-4.6-1
popt-1.16-1
zlib-1.2.7-2
readline-6.2-4

yum installation package

The latest yum installation package for AIX is available here: https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/yum_bundle.tar

The archive contains the following rpm packages:

ca-certificates-2016.10.7-2.aix6.1.ppc.rpm    python-iniparse-0.4-1.aix6.1.noarch.rpm
curl-7.52.1-1.aix6.1.ppc.rpm                  python-pycurl-7.19.3-1.aix6.1.ppc.rpm
db-4.8.24-3.aix6.1.ppc.rpm                    python-tools-2.7.10-1.aix6.1.ppc.rpm
gdbm-1.8.3-5.aix5.2.ppc.rpm                   python-urlgrabber-3.10.1-1.aix6.1.noarch.rpm
gettext-0.19.7-1.aix6.1.ppc.rpm               readline-6.1-2.aix6.1.ppc.rpm
glib2-2.14.6-2.aix5.2.ppc.rpm                 sqlite-3.15.2-1.aix6.1.ppc.rpm
pysqlite-1.1.7-2.aix6.1.ppc.rpm               yum-3.4.3-5.aix6.1.noarch.rpm
python-2.7.10-1.aix6.1.ppc.rpm                yum-metadata-parser-1.1.4-2.aix6.1.ppc.rpm
python-devel-2.7.10-1.aix6.1.ppc.rpm

On a vanilla AIX system, yum will be installed easily by running:

rpm -Uvh *rpm

If everything go well, yum is installed and ready to work.

possible problems

packages conflict

On older systems where rpm packages from other sources are already installed, the installation can be more complicated because you will have conflicts between IBM rpm packages and the installed ones.

Typical errors I have seen are about the readline and sometime glib2 packages being already installed:

Preparing...                ########################################### [100%]
        package readline-6.2-4.ppc (which is newer than readline-6.1-2.ppc) is already installed
        package glib2-2.30.3-1.ppc (which is newer than glib2-2.14.6-2.ppc) is already installed

Like said before this packages contents have already been replaced by the rpm.rte package. So to clean up, you can force install the IBM version

rpm -ivh --force readline*rpm glib*rpm

Or you can skip them from the installation:

rpm -Uvh $(ls *rpm|egrep -v "readline|glib")
Preparing...                ########################################### [100%]
   1:sqlite                 ########################################### [  6%]
/
   2:gettext                ########################################### [ 13%]
add libintl.so.1 (32bits) shared member to /opt/freeware/lib/libintl.a
add libintl.so.1 (64bits) shared member to  /opt/freeware/lib/libintl.a
/
   3:glib2                  ########################################### [ 19%]
   4:yum-metadata-parser    ########################################### [ 25%]
   5:gdbm                   ########################################### [ 31%]
   6:db                     ########################################### [ 38%]
   7:python                 ########################################### [ 44%]
   8:pysqlite               ########################################### [ 50%]
   9:python-iniparse        ########################################### [ 56%]
  10:ca-certificates        ########################################### [ 63%]
  11:curl                   ########################################### [ 69%]
  12:python-pycurl          ########################################### [ 75%]
  13:python-urlgrabber      ########################################### [ 81%]
  14:yum                    ########################################### [ 88%]
  15:python-devel           ########################################### [ 94%]
  16:python-tools           ########################################### [100%]

missing TK and TCL packages

Another common problem is when TK and TCL are not installed. You will see this error message:

rpm -Uvh *rpm
error: Failed dependencies:
        libtcl8.4.so is needed by python-2.7.10-1.ppc
        libtk8.4.so is needed by python-2.7.10-1.ppc

So you need to install tk.base and tcl.base bff package.

For example if you are using NIM:

nimclient -o cust -a lpp_source="lppsource_61-09-06" -a filesets="tcl.base tk.base" -a accept_licenses=yes

internet access

http proxy

If you are lucky you have a direct internet access. :) If you are a little bit less lucky you can still have an internet proxy. It’s possible to configure yum to use a http proxy by editing the configuration file /opt/freeware/etc/yum/yum.conf and add the proxy parameter in the main stanza.

[main]
plugins=1
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
proxy=https://myproxyserver:3128


[AIX_Toolbox]
name=AIX generic repository
baseurl=https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/
enabled=1
gpgcheck=0

local repository

Without internet access, the best solution is to create a self hosted repository with an apache/NGINX server.

The createrepo package and his dependencies are provided by IBM on the Linux AIX toolbox website. I

==================================================================================================================
 Package                       Arch                 Version                Repository                        Size
==================================================================================================================
Installing:
 createrepo                    noarch               0.10.3-3               AIX_Toolbox_noarch                90 k
Installing for dependencies:
 deltarpm                      ppc                  3.6-1                  AIX_Toolbox                      403 k
 libxml2                       ppc                  2.9.5-1                AIX_Toolbox                      5.3 M
 libxml2-python                ppc                  2.9.5-1                AIX_Toolbox                      1.5 M
 python-deltarpm               ppc                  3.6-1                  AIX_Toolbox                       81 k
 xz                            ppc                  5.2.2-1                AIX_Toolbox                      235 k
 xz-libs                       ppc                  5.2.2-1                AIX_Toolbox                      404 k

Transaction Summary
==================================================================================================================
Install       7 Packages

Total download size: 8.0 M
Installed size: 29 M

So the solution is to copy the rpm packages from the AIX linux toolbox cdrom or download all packages from the aix linux toolbox website and create the repository with createrepo:

You can use wget to download the packages from IBM website:

 wget -r --no-parent --reject "index.html*" -e robots=off -k https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/

Everything will be downloaded in a directory named public.dhe.ibm.com. You need to create the repository metadata informations with createrepo:

createrepo /appli/repository/public.dhe.ibm.com

The last step is to provide this packages through a HTTP server.

A simple configuration file for a Apache virtual host could be:

<VirtualHost *:80>

  ServerName repository.mydomain.com
  DocumentRoot /appli/repository/public.dhe.ibm.com


  <Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
  </Directory>

  LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
  ErrorLog /var/log/httpd/repos_error.log
  CustomLog /var/log/httpd/repos_forwarded.log common_forwarded
  CustomLog /var/log/httpd/repos_access.log combined env=!dontlog
  CustomLog /var/log/httpd/repos.log combined

</VirtualHost>

On each client, it’s necessary to update the /opt/freeware/etc/yum/yum.conf file to add the repository information below.

Replace the base url information by your server name.

[local_ibm_tools]
name=Local AIX IBM packages
baseurl=http://repository.mydomain.com/public.dhe.ibm.com
gpgcheck=0
enabled=1

You can see list the new repository:

yum repolist

yum repolist
local_ibm_tools                                                                                 | 2.9 kB  00:00:00
local_ibm_tools/primary_db                                                                      |  84 kB  00:00:00
repo id                                             repo name                                                    status
local_ibm_tools                                     Local AIX IBM packages                                       183

It’s possible to list every package in thisq repository with this command:

# yum --disablerepo="*" --enablerepo="local_ibm_tools" list available
Available Packages
AfterStep.ppc                                        1.8.10-1                                           local_ibm_tools
ElectricFence.ppc                                    2.2.2-1                                            local_ibm_tools
Eterm.ppc                                            0.8.10-5                                           local_ibm_tools
Eterm-backgrounds.ppc                                0.8.10-5                                           local_ibm_tools
GConf2.ppc                                           2.4.0.1-1                                          local_ibm_tools
GConf2-devel.ppc                                     2.4.0.1-1                                          local_ibm_tools
ImageMagick.ppc                                      5.4.2-3                                            local_ibm_tools
ImageMagick-devel.ppc                                5.4.2-3                                            local_ibm_tools
MySQL.ppc                                            3.23.58-2                                          local_ibm_tools
MySQL-client.ppc                                     3.23.58-2                                          local_ibm_tools
MySQL-devel.ppc                                      3.23.58-2                                          local_ibm_tools
ORBit.ppc                                            0.5.12-1                                           local_ibm_tools
ORBit-devel.ppc                                      0.5.12-1                                           local_ibm_tools
ORBit2.ppc                                           2.8.1-1                                            local_ibm_tools
ORBit2-devel.ppc                                     2.8.1-1                                            local_ibm_tools

The major difference with this solution and the web repositories from IBM is that IBM provides dedicated repository for each AIX version. Here everything is in the same repository so some cleaning/reorganizing is necessary before using it.