AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only

Configuring DNF and creating local repositories on IBM AIX

By Sumitra Dawn posted 2 hours ago

  

Introduction


The AIX Toolbox for Open Source Software (AIX Toolbox) is a collection of open source software built in RPM Package Manager (RPM)
format, designed for IBM AIX systems.

The AIX Toolbox now offers DNF, also known as dandified yum, as the advanced successor to the familiar Yellowdog Updater, modified
(yum). In this evolution, yum, a package manager founded on python2, has become unsupported within the community. Consequently, a
compelling shift toward a python3-compatible package manager, DNF was imperative. DNF seamlessly maintains CLI compatibility with
yum, enforces a robust API framework for extensions and plugins, and leverages well-documented APIs. It employs a state-of-the-art
SAT-based dependency solver. Notably, existing AIX Toolbox repositories designed for yum seamlessly integrate with DNF, requiring no
repository-side adjustments.

This tutorial outlines multiple approaches for installing DNF, establishing local DNF repositories containing AIX Toolbox RPM packages,
and configuring DNF.

Prerequisites


To make the most of this tutorial, it is beneficial for users to possess basic proficiency in:


Space and system requirements

    • 512 MB /tmp free space.
    • 512 MB /opt free space.
    • DNF operates on AIX 7.2 TL5 and higher versions.
    • Installation of Openssl 1.1.X.X or a later version is essential.


Estimated time to complete

This tutorial requires approximately 30 minutes for a thorough comprehension.


Steps


Configure DNF


This method is recommended when users have direct Internet access and can establish a connection with the IBM public FTP server.

Download the dnf_aixtoolbox.sh script and run it as the root user. This script performs the following tasks:

    • Downloads the appropriate dnf_bundle_aix71_72.tar or dnf_bundle_aix73.tar file based on the AIX version.
    • Ensures installation of the required rpm.rte version (rpm.rte-4.15.1.1016 or higher for AIX 7.1 and 7.2,
      rpm.rte-4.15.1.2014 for AIX 7.3 TL0 & TL1, rpm.rte-4.18.1.2006 for AIX 7.3 TL3).
    • The DNF bundle encompasses DNF and its associated packages.
    • Checks for existing installation of any package from the DNF bundle and installs the packages accordingly.

The DNF script can be utilized with the following options:

dnf_aixtoolbox.sh <-d> <-y> <-n>

    • <-d>: Installs and sets up DNF if yum is absent. Only the dnf command will be available.
    • <-y>: Installs DNF and updates yum3 to DNF yum4 (if yum3 exists). If yum3 is not installed, both DNF and yum4 will be installed.
      Both dnf and yum commands will be accessible.
    • <-n>: Installs DNF alongside yum, allowing coexistence with an existing yum installation. This option is not recommended.


Create a local DNF repository


To setup a local DNF repository, Internet access is required on one system, which will serve as the repository for other AIX systems.

To ensure better understanding, the system with Internet access (creating the local DNF repository) is referred to as the Repo server.
The other AIX systems using this repository are known as AIX Repo clients.

The Repo server must be an RPM-based system (AIX or an RPM-based Linux®). The HTTP server should be operational on the Repo server,
with the repository directory accessible to AIX Repo clients via HTTP. This facilitates DNF connections and retrieval of RPM packages.

Refer to the following steps (1-7) to create and use the local DNF repository. Steps 1-6 should be run on the Repo server and step 7 on the AIX
Repo clients.

  1. Install the dnf-utils and createrepo_c packages using the following commands:

    dnf install dnf-utils
    dnf install createrepo_c
  2. Create the AIX Toolbox repository entries in the repository file:

    • On the Linux Repo server: '/etc/dnf.repos.d/AIX-Toolbox.repo'
    • On the AIX Repo server: the default DNF configuration file '/opt/freeware/etc/dnf/dnf.conf' is installed. Ensure that the following
      entries are present.

      [AIX_Toolbox]
      name=AIX generic repository
      baseurl=https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/
      [AIX_Toolbox_noarch]
      name=AIX noarch repository
      baseurl=https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/noarch/
      [AIX_Toolbox_71]
      name=AIX 7.1 specific repository
      baseurl=https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/
      [AIX_Toolbox_72]
      name=AIX 7.2 specific repository
      baseurl=https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/
      [AIX_Toolbox_73]
      name=AIX 7.3 specific repository
      baseurl=https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.3/

       

  3. Verify whether the AIX repositories are enabled. 

    # dnf repolist
    repo id                      repo name
    AIX_Toolbox                  AIX generic repository
    AIX_Toolbox_71               AIX 7.1 specific repository
    AIX_Toolbox_72               AIX 7.2 specific repository
    AIX_Toolbox_73               AIX 7.3 specific repository
    AIX_Toolbox_noarch           AIX noarch repository
  4. Sync all AIX Toolbox repository to the Repo server using reposync command. Specify the repository ID using the --repo option,
    Otherwise, reposync will try to sync all enabled repositories.  -p is the path to copy rpm filesand -a specifies an architecture.

    # reposync -p <target_path> --repo AIX_Toolbox -a ppc
    # reposync -p <target_path> --repo AIX_Toolbox_71 -a ppc
    # reposync -p <target_path> --repo AIX_Toolbox_72 -a ppc
    # reposync -p <target_path> --repo AIX_Toolbox_73 -a ppc
    # reposync -p <target_path> --repo AIX_Toolbox_noarch

  5.  Verify whether all the repositories are synchronized.

    # ls <target_path>/
    AIX_Toolbox AIX_Toolbox_71 AIX_Toolbox_noarch
    AIX_Toolbox_72 AIX_Toolbox_73
    # ls <target_path>/AIX_Toolbox


    Note:
     In this example, all the AIX Toolbox repository RPM package directories are displayed.

  6. Create the DNF repository for all the downloaded packages using createrepo command.

     # createrepo_c <target_path>/AIX_Toolbox
     # createrepo_c <target_path>/AIX_Toolbox_71
     # createrepo_c <target_path>/AIX_Toolbox_72
     # createrepo_c <target_path>/AIX_Toolbox_73
     # createrepo_c <target_path>/AIX_Toolbox_noarch
  7. Edit the /opt/freeware/etc/dnf/dnf.conf file on the AIX system.
            Edit the file to add and enable the newly created repository on the Linux system.


    Note: Upon initial run, reposync  synchronizes all available RPM packages within the DNF repository, encompassing both older RPM
    packages enabled via DNF. Subsequent package updates prompt reposync to exclusively copy updated RPM packages, preserving older
    ones on the system. Upon invoking createrepo, the DNF repository accumulates both older and newer RPM packages. This process holds
    true during synchronization as well.

    reposync selectively copies RPMs, excluding repodata files, from designated repodata locations while maintaining the RPM directory
    structure. Notably, the repository structure may differ from AIX Toolbox, necessitating users to modify the dnf.conf file to establish the accurate path.

    For instance, within AIX Toolbox, the baseurl appears as:
    baseurl=https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/

    Using reposync, copies RPMs as follows:

    # ls <target_path>/AIX_Toolbox
    a2ps expat .........


    Upon running createrepo on the Repo Server, the repository URL in AIX should align with:
    baseurl=https://<Repo server/target_path>/AIX_Toolbox/

    Other methods, such as setting up DNF from ISO image, are also available.
    For more information on this topic, refer to the blog post Creating local repo with DNF and AIX Toolbox Media Image.


    Summary


    Understanding the enterprise's needs in terms of DNF repository setup is crucial. It depends on the organization's security standards.
    If public network access is permissible, utilizing AIX Toolbox repositories is optimal. However, setting up a single server to connect to

    a public network and serve DNF repositories to private systems emerges as the recommended approach when stringent security measures are in place.

0 comments
11 views

Permalink