AIX Open Source

 View Only

Creating local repo with DNF and AIX Toolbox Media Image

By SANGAMESH MALLAYYA posted Wed February 09, 2022 11:52 AM

  


This forum post gives information on how one can set up a local repository for an AIX  system where no
internet access is allowed due to the organization’s security policy.

Up to now such users had only two options to install toolbox packages.

  1. By downloading the list of packages to be installed manually from the AIX toolbox website.
  2. By downloading toolbox media iso image or tar file and installing packages manually by mounting an                                                                                                      iso media image or extracting the tar file.

With both the options users needed to know the list of dependencies and pass that list to the rpm command
for installation.

 

With the latest toolbox media images a user also has the option of setting up a local DNF repository using AIX
toolbox iso image or AIX toolbox compressed tar file for AIX versions 7.1, 7.2 and 7.3.
With local repositories users can install packages using DNF command without needing to know the list of dependencies to be installed.

The script to setup DNF local repo checks for AIX version and setup DNF and add local repositries accordingly.


Please follow the below steps for setting up DNF local repo.

The output shown in below steps for reference is for the AIX 7.3.
Except some output differences the steps are common for AIX releases mentioned.

    1. Download AIX toolbox media ISO/tar format image from either the Entitled System Support (ESS)                                                                                                            
        website or the Passport Advantage (PPA) website depending on which AIX product you have entitlement for.

        a. ESS: Download either the ISO or tar.gz image from the 2259 feature of your AIX product entitlement.
        b. PPA: Download the file associated with one of the following current parts M04S8ML (.tar.gz) or M04SBML (.iso).
            In the future look for the most recent AIX eAssembly and download the file for one of the two entries labelled in part,
           “IBM AIX Toolbox for Linux Applications”.

    2. Mount the iso or extract the .tar.gz file into the path of your preference where it should have the required free disk
        space of around 6.6GB for .tar.gz extraction.

        For example, in this tutorial we take /mnt as our iso image mount path or .tar.gz extraction path.                

       # df -m /
       Filesystem         MB blocks               Free        %Used           Iused   %Iused   Mounted on
       /dev/hd4            13312.00               6681.69       50%         4116             1%   /

        # gzip -dc aix_linux_toolbox_*.tar.gz | tar xf - -C /mnt                       

        or

        # loopmount -i aix_linux_toolbox_*.iso -o "-V udfs -o ro" -m /mnt


    3. Run the dnf_aixtoolbox_local.sh script located at /mnt/ezinstall/ppc/dnf_aixtoolbox_local.sh

 
        # /mnt/ezinstall/ppc/dnf_aixtoolbox_local.sh
        Usage: dnf_aixtoolbox_local.sh <mount path or tar extraction path>

                     mount path should be Absolute path where the AIX Toolbox iso image is
                     being mounted or the path where AIX Toolbox tar file has been extracted.

        # /mnt/ezinstall/ppc/dnf_aixtoolbox_local.sh /mnt

        Copying dnf_bundle_aix_73.tar to /tmp/dnf-20220619090928 .....

        Extracting dnf_bundle_aix_73.tar ...
        x ca-certificates-2020.06.01-0.aix7.1.ppc.rpm, 952182 bytes, 1860 media blocks.
        x dnf-4.2.17-64_3.aix7.1.noarch.rpm, 11038 bytes, 22 media blocks.
        x dnf-automatic-4.2.17-64_3.aix7.1.noarch.rpm, 12495 bytes, 25 media blocks.
        x dnf-data-4.2.17-64_3.aix7.1.noarch.rpm, 25705 bytes, 51 media blocks.
        x extra_list, 218 bytes, 1 media blocks.
        x install_dnf.sh, 14005 bytes, 28 media blocks.
        x install_dnf.sh_bak, 13648 bytes, 27 media blocks.
        x libcomps-0.1.11-64_1.aix7.1.ppc.rpm, 1311685 bytes, 2562 media blocks.
        x libdnf-0.39.1-64_2.aix7.1.ppc.rpm, 16662087 bytes, 32544 media blocks.
        x libmodulemd-1.5.2-64_1.aix7.1.ppc.rpm, 3509662 bytes, 6855 media blocks.
        x librepo-1.11.0-64_1.aix7.1.ppc.rpm, 4008061 bytes, 7829 media blocks.
        x libsmartcols-2.34-64_1.aix7.1.ppc.rpm, 187658 bytes, 367 media blocks.
        x libsolv-0.7.9-64_1.aix7.1.ppc.rpm, 1572946 bytes, 3073 media blocks.
        x libzstd-1.4.4-64_1.aix7.1.ppc.rpm, 471063 bytes, 921 media blocks.
        x p11-kit-0.23.16-0.aix7.1.ppc.rpm, 1047702 bytes, 2047 media blocks.
        x p11-kit-tools-0.23.16-0.aix7.1.ppc.rpm, 39777 bytes, 78 media blocks.
        x python3-3.7.9-0.aix7.1.ppc.rpm, 43168080 bytes, 84313 media blocks.
        x python3-dateutil-2.8.0-1.aix6.1.noarch.rpm, 363137 bytes, 710 media blocks.
        x python3-devel-3.7.9-0.aix7.1.ppc.rpm, 237244 bytes, 464 media blocks.
        x python3-dnf-4.2.17-64_3.aix7.1.noarch.rpm, 197417 bytes, 386 media blocks.
        x python3-dnf-plugin-migrate-4.0.16-6_64.aix7.1.noarch.rpm, 7987 bytes, 16 media blocks.
        x python3-dnf-plugins-core-4.0.16-6_64.aix7.1.noarch.rpm, 49244 bytes, 97 media blocks.
        x python3-docs-3.7.9-0.aix7.1.ppc.rpm, 2993180 bytes, 5847 media blocks.
        x python3-gpgme-1.13.1-64_1.aix7.1.ppc.rpm, 950413 bytes, 1857 media blocks.
        x python3-hawkey-0.39.1-64_2.aix7.1.ppc.rpm, 3315808 bytes, 6477 media blocks.
        x python3-libcomps-0.1.11-64_1.aix7.1.ppc.rpm, 1048900 bytes, 2049 media blocks.
        x python3-libdnf-0.39.1-64_2.aix7.1.ppc.rpm, 23976752 bytes, 46830 media blocks.
        x python3-librepo-1.11.0-64_1.aix7.1.ppc.rpm, 2471654 bytes, 4828 media blocks.
        x python3-six-1.13.0-1.aix6.1.noarch.rpm, 514483 bytes, 1005 media blocks.
        x python3-test-3.7.9-0.aix7.1.ppc.rpm, 28383122 bytes, 55436 media blocks.
        x python3-tools-3.7.9-0.aix7.1.ppc.rpm, 12734 bytes, 25 media blocks.
        x rpm-python3-4.15.1-64_2.aix7.1.ppc.rpm, 101486 bytes, 199 media blocks.
        x rpmlibs32-4.15.1.0-32_1.aix7.1.ppc.rpm, 732081 bytes, 1430 media blocks.
        x yum-4.2.17-64_3.aix7.1.noarch.rpm, 8953 bytes, 18 media blocks.
        x zchunk-1.1.4-64_1.aix7.1.ppc.rpm, 489162 bytes, 956 media blocks.
        x zchunk-devel-1.1.4-64_1.aix7.1.ppc.rpm, 19127 bytes, 38 media blocks.
        x zchunk-libs-1.1.4-64_1.aix7.1.ppc.rpm, 559707 bytes, 1094 media blocks.


        Checking whether any of the rpms from dnf_bundle are already installed...
        Takes couple of minutes to process.

        ca-certificates-2020.06.01-0 will be installed
        dnf-4.2.17-64_3 will be installed
        dnf-automatic-4.2.17-64_3 will be installed
        dnf-data-4.2.17-64_3 will be installed
        libcomps-0.1.11-64_1 will be installed
        libdnf-0.39.1-64_2 will be installed
        libmodulemd-1.5.2-64_1 will be installed
        librepo-1.11.0-64_1 will be installed
        libsmartcols-2.34-64_1 will be installed
        libsolv-0.7.9-64_1 will be installed
        libzstd-1.4.4-64_1 will be installed
        p11-kit-0.23.16-0 will be installed
        p11-kit-tools-0.23.16-0 will be installed
        python3-3.7.9-0 will be installed
        python3-dnf-4.2.17-64_3 will be installed
        python3-gpgme-1.13.1-64_1 will be installed
        python3-hawkey-0.39.1-64_2 will be installed
        python3-libcomps-0.1.11-64_1 will be installed
        python3-libdnf-0.39.1-64_2 will be installed
        python3-librepo-1.11.0-64_1 will be installed
        rpm-python3-4.15.1-64_2 will be installed
        yum-4.2.17-64_3 will be installed
        zchunk-libs-1.1.4-64_1 will be installed

        Installing the packages...

        Verifying... ################################# [100%]
         Preparing... ################################# [100%]
         Updating / installing...
         1:python3-3.7.9-0 ################################# [ 4%]
         2:libzstd-1.4.4-64_1 ################################# [ 9%]
         3:libmodulemd-1.5.2-64_1 ################################# [ 13%]
         4:libsolv-0.7.9-64_1 ################################# [ 17%]
         5:libsmartcols-2.34-64_1 ################################# [ 22%]
         6:zchunk-libs-1.1.4-64_1 ################################# [ 26%]
         7:librepo-1.11.0-64_1 ################################# [ 30%]
         8:rpm-python3-4.15.1-64_2 ################################# [ 35%]
         9:libdnf-0.39.1-64_2 ################################# [ 39%]
       10:python3-libdnf-0.39.1-64_2 ################################# [ 43%]
       11:dnf-data-4.2.17-64_3 ################################# [ 48%]
       12:python3-hawkey-0.39.1-64_2 ################################# [ 52%]
       13:libcomps-0.1.11-64_1 ################################# [ 57%]
       14:python3-libcomps-0.1.11-64_1 ################################# [ 61%]
       15:python3-gpgme-1.13.1-64_1 ################################# [ 65%]
       16:python3-dnf-4.2.17-64_3 ################################# [ 70%]
       17:dnf-4.2.17-64_3 ################################# [ 74%]
       18:p11-kit-0.23.16-0 ################################# [ 78%]
       19:p11-kit-tools-0.23.16-0 ################################# [ 83%]
       20:ca-certificates-2020.06.01-0 ################################# [ 87%]
       21:dnf-automatic-4.2.17-64_3 ################################# [ 91%]
       22:yum-4.2.17-64_3 ################################# [ 96%]
       23:python3-librepo-1.11.0-64_1 ################################# [100%]

        dnf installed successfully.
        Please run 'dnf update' to update packages to the latest level.

        Please note, RPM packages are downloaded in dnf cache /var/cache/dnf.
        RPM packages install files go under the path /opt.
        Hence it is recommended to always keep at least 512MB of free space in /var & /opt
        to avoid any download and installation/update failures.

        Creating the dnf.conf file with required locale repositories.
        The default /opt/freeware/etc/dnf/dnf.conf has been saved as /opt/freeware/etc/dnf/dnf.conf_local_bak

 

    4. Verify the /opt/freeware/etc/dnf/dnf.conf if local repository entries are created correctly.

 

        # cat /opt/freeware/etc/dnf/dnf.conf

        [main]

        cachedir=/var/cache/dnf

        keepcache=1

        debuglevel=2

        logfile=/var/log/dnf.log

        exactarch=1

        gpgcheck=1

        installonly_limit=3

        clean_requirements_on_remove=True

        best=True

 

        plugins=1

 

        [Local_AIX_Toolbox]

        name=Local AIX generic repository

        baseurl=file:///mnt/RPMS/ppc/

        enabled=1

        gpgcheck=0

 
        [Local_AIX_Toolbox_noarch]

        name=Local AIX noarch repository

        baseurl=file:///mnt/RPMS/noarch/

        enabled=1

        gpgcheck=0

 

        [Local_AIX_Toolbox_73]

        name=Local AIX 7.3 specific repository

        baseurl=file:///mnt/RPMS/ppc-7.3/

        enabled=1

        gpgcheck=0

 

    5. Run dnf repolist to list the local repositories.

       
        # dnf repolist

        repo id                                           repo name

        Local_AIX_Toolbox                                 Local AIX generic repository

        Local_AIX_Toolbox_73                              Local AIX 7.3 specific repository

        Local_AIX_Toolbox_noarch                          Local AIX noarch repository

 
    6. Run dnf update to update packages to the latest version.

 

        # dnf update
         Local AIX generic repository 3.0 MB/s | 3.0 kB 00:00
         Local AIX noarch repository 3.0 MB/s | 3.0 kB 00:00
         Local AIX 7.3 specific repository 2.9 MB/s | 3.0 kB 00:00
         Dependencies resolved.
         ==============================================================================================================
         Package                                   Architecture               Version                       Repository                                                       Size
         ==============================================================================================================
        Upgrading:
          ca-certificates                      ppc                                2020.06.01-2          Local_AIX_Toolbox                                      925 k
          p11-kit                                   ppc                                0.23.22-1                  Local_AIX_Toolbox                                      4.3 M
          p11-kit-tools                        ppc                                0.23.22-1                  Local_AIX_Toolbox                                      198 k
          python3                                 ppc                                3.7.12-1                     Local_AIX_Toolbox                                      39 M
       Installing dependencies:
          bash                                       ppc                                 5.1.4-2                       Local_AIX_Toolbox                                      2.8 M
          bzip2                                      ppc                                 1.0.8-2                       Local_AIX_Toolbox                                      238 k
          expat                                      ppc                                 2.4.4-1                       Local_AIX_Toolbox                                     985 k
          gdbm                                      ppc                                1.19-1                         Local_AIX_Toolbox                                     274 k
          gettext                                   ppc                                0.20.2-1                      Local_AIX_Toolbox                                    11 M
          glib2                                       ppc                                2.56.1-3                      Local_AIX_Toolbox                                    16 M
          info                                         ppc                                6.7-1                             Local_AIX_Toolbox                                    699 k
          libffi                                        ppc                                3.2.1-3                         Local_AIX_Toolbox                                    47 k
          libiconv                                  ppc                                1.16-1                          Local_AIX_Toolbox                                    1.6 M
          libtasn1                                 ppc                                4.16.0-1                       Local_AIX_Toolbox                                    200 k
          libtextstyle                           ppc                                0.20.2-1                       Local_AIX_Toolbox                                    1.1 M
          libunistring                           ppc                                0.9.10-1                       Local_AIX_Toolbox                                    1.5 M
          libxml2                                  ppc                                2.9.11-1                       Local_AIX_Toolbox                                    5.5 M
          ncurses                                 ppc                                6.2-3                              Local_AIX_Toolbox                                    3.5 M
          readline                                ppc                                 8.1-1                              Local_AIX_Toolbox                                   2.5 M
          sqlite                                     ppc                                 3.35.5-1                        Local_AIX_Toolbox                                   8.7 M
          xz-libs                                   ppc                                 5.2.5-1                           Local_AIX_Toolbox                                   540 k
          zlib                                         ppc                                 1.2.11-2                        Local_AIX_Toolbox                                   335 k
          libgcc                                     ppc                                1:10-2                            Local_AIX_Toolbox_73                           15 k
          libgcc10                                ppc                                10.3.0-6                        Local_AIX_Toolbox_73                           794 k
          libgomp                                ppc                                 1:10-2                            Local_AIX_Toolbox_73                          14 k
          libgomp10                           ppc                                 10.3.0-6                        Local_AIX_Toolbox_73                          2.0 M
          libstdc++                              ppc                                1:10-2                            Local_AIX_Toolbox_73                          14 k
          libstdc++10                         ppc                                10.3.0-6                        Local_AIX_Toolbox_73                          19 M

          Transaction Summary
          ==============================================================================================================
          Install           24       Packages
          Upgrade         4        Packages

          Total size: 123 M
          Is this ok [y/N]: y
          Downloading Packages:
          Running transaction check
          Transaction check succeeded.
          Running transaction test
          Transaction test succeeded.
          Running transaction
          Preparing                   :                                                                1/1
          Installing                    : libgcc10-10.3.0-6.ppc                    1/32
          Installing                    : libgcc-1:10-2.ppc                            2/32
          Installing                    : libffi-3.2.1-3.ppc                              3/32
          Installing                    : zlib-1.2.11-2.ppc                             4/32
          Installing                    : libstdc++10-10.3.0-6.ppc             5/32

          ……………………….

 

 

8 comments
719 views

Permalink

Comments

Wed July 31, 2024 07:54 AM

Fri July 21, 2023 06:44 AM

 I dont have customer number. How to download .tar/.so without it ?

Tue November 01, 2022 12:38 PM

@SANGAMESH MALLAYYA
Hi, thanks ! I have checked the dnf.conf file and problem was there, actually I have given full path of repo, while i compare dnf.conf file with yum.conf file of another yum repo. I found path is starting from first sub-directory like
full path is file:///a/b/c/d/ppc on repo, but it is working with http://repoip/b/c/d/ppc on client. I don't know why?

Thanks
Hardeep Singh

Mon October 31, 2022 01:48 PM

Hi Hardeep,

Please recheck your dnf.conf file entries if they are correct.

Sun October 30, 2022 11:23 PM

Hi, @SANKET RATHI
I have installed dnf local repo in my AIX server successfully and it is working fine locally but when I am accessing it in other server over http it is giving me status code 404 error could not download metadata. I have installed httpd in repo server any help.

cheers
Hardeep SIngh

Fri October 21, 2022 03:09 AM

@Jaqui Lynch If you are creating it from ISO image then it is mostly static. With every AIX release ISO image is updated with the latest snapshot of AIX toolbox and you can update that time.

But if you want a repo that is upto date then the best way to create a local yum repo on the system that has internet connection and use reposync.

There is an article for same https://developer.ibm.com/articles/configure-yum-on-aix/. This article is based on yum but same can be used for dnf.

Thu August 04, 2022 03:30 PM

I have a question about how you update the local repository moving forward.  Here is my setup - I have a NIM lpar that can get to IBM so I use dnf on it to get all the latest patches and I keep it up to date.

It has an NFS export of /software/dnf/repo what is exported to all the systems.  I have downloaded and untarred the aixtoolbox from Feb 2022 and used it to build the local repo.  But what I want to know is how I update it moving forward when I want do get the latest of some software

Thanks

Jaqui

Fri May 27, 2022 04:58 PM

FYI:  The ESS site https://www.ibm.com/servers/eserver/ess

Start at ESS:

https://www.ibm.com/servers/eserver/ess/ProtectedServlet.wss

My Entitled Software --> Software Downloads

Category: AIX

Group: V7R3 (GA)

The images are available under the Enterprise, and Standard editions:

5765-CD3 AIX Enterprise Edition 7.2 and 7.3

- 0957: AIX Toolbox for Linux Source v06.01.00,ENU,DVD

- 2259: AIX Toolbox for Linux APPS v06.01.00,ENU,DVD

5765-G98 AIX Standard Edition 7.1, 7.2 and 7.3

- 0957: AIX Toolbox for Linux Source v06.01.00,ENU,DVD

- 2259: AIX Toolbox for Linux APPS v06.01.00,ENU,DVD

If you don't see these options, you will need to contact the ESS support to find out why they are not available. 

Need help?