AIX Open Source

 View Only
  • 1.  offline downloading aix toolbox packages and all dependencies from a Linux system.

    Posted Fri May 26, 2023 12:28 PM

    Hello All, 
    all the aix systems we have are cut off from the internet. due to some migration i need to download a couple of packages like curl. etc but I am not able to download them. 
    I downloaded dnf on the aix server but without internet there is no use. 

    i can use a laptop which runs rhel which can have internet access. 

    I tried adding the repos to yum.repos.d/aixtoolbox. and i try to downoad only with dnf 

    dnf download --disablerepo='*' --repo='aix_toolbox' --resolve curl  or yumdownloader --arch ppc --resolve curl 

     

    it find the correct curl ppc version 

    curl-8.0.1-1.ppc 

    but had errors like 
    package curl... does not have compatible architecture 
    nothing provides libc.a(shr.o) needed by curl....
    ... 
    etc 

    i can download the packages individually if i don't use --resolve.. but then how can i get the rpm package names of all the dependencies and i will do a loop or something.





    ------------------------------
    Mario Garcia
    ------------------------------


  • 2.  RE: offline downloading aix toolbox packages and all dependencies from a Linux system.

    IBM Champion
    Posted Mon May 29, 2023 04:32 AM

    You can't use the "resolve" because that tries to resolve the packages against the list of packages (and cpuarch/OS) of your laptop.  Even if you convince it to use a different cpuarch/OS, it's still missing the "provided-by" of the RPM.rte.

    What may work (with a lot of work/investigation):

    - Create an RPM-based container that uses about the same versions of RPM/DNF
    - Overwrite the DNF/RPM databases with those of the AIX system
    - Overwrite the relevant OS&arch lines with AIX/ppc64
    - Try the DNF download

    Alternatively, it's probably easier to get a full copy of the aixlinuxtoolbox repository, then share it internaly.



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 3.  RE: offline downloading aix toolbox packages and all dependencies from a Linux system.

    Posted Fri June 02, 2023 02:30 AM
    Edited by Ayappan P Fri June 02, 2023 08:49 AM

    Hello there Mario,

    tl;dr

    I slightly modified `dnf` to allow downloading rpm's with missing dependencies, but it still misses
    all of the AIX toolbox repository dependencies of the desired package. In my case, `gcc`. Read on
    for more information. I give a solution as well.

    Information

    First, your issue related to `libc.a(shr.o)` missing is because it is provided by `AIX-rpm` that
    is not present on the AIX toolbox repositories. It comes by default when rpm is installed.

    Plus, you may also have gotten:
     Problem: conflicting requests
    - package xxxxx.ppc does not have a compatible architecture

    And this happens because you have to specify the target architecture. In this case, it's ppc.

    So, you have to add --forcearch=ppc if you want to download rpm's for AIX systems running on POWER.

    Attempt

    Second,

    dnf was not letting me download any packages as the AIX toolbox rpm repository does not have the AIX-rpm package.

    See:
    $ dnf download --forcearch=ppc --repo='AIX_Toolbox_*' --alldeps --resolve gcc-8 gcc8-8.3.0-6
    Last metadata expiration check: 1:06:25 ago on Thu 01 Jun 2023 06:29:48 PM EDT.
    Error in resolve of packages:
        gcc-1:8-1.ppc
        gcc-1:8-1.ppc
        gcc8-8.3.0-6.ppc
        gcc8-8.3.0-6.ppc

     Problem: conflicting requests
      - nothing provides AIX-rpm < 7.3.0.0 needed by gcc-1:8-1.ppc
      - nothing provides AIX-rpm >= 7.2.0.0 needed by gcc-1:8-1.ppc

    $ robfree@lnix-roberto-tp: /tmp

    So, I went and looked at dnf's source to see how I could remove that limitation.

    So, I ended up slightly modifying the dnf package manager to allow me to download a package with
    missing dependencies (such as AIX-rpm that is not present on the AIX toolbox repositories), but
    it looks like dnf still does not download all the dependencies.

    As you can see, I only commented out the exception thrown if we hit a package that is not present
    in a repository.


    $ git diff /usr/lib/python3.11/site-packages/dnf-plugins/download.py_backup /usr/lib/python3.11/site-packages/dnf-plugins/download.py
    diff --git a/usr/lib/python3.11/site-packages/dnf-plugins/download.py_backup b/usr/lib/python3.11/site-packages/dnf-plugins/download.py
    index d8ce4be..2429c95 100644
    --- a/usr/lib/python3.11/site-packages/dnf-plugins/download.py_backup
    +++ b/usr/lib/python3.11/site-packages/dnf-plugins/download.py
    @@ -261,7 +261,7 @@ class DownloadCommand(dnf.cli.Command):
                     msg = [_('Error in resolve of packages:')]
                     logger.error("\n    ".join(msg + [str(pkg) for pkg in pkgs]))
                     logger.error(dnf.util._format_resolve_problems(goal.problem_rules()))
    -                raise dnf.exceptions.Error()
    +                #raise dnf.exceptions.Error()
             return pkg_set

         @staticmethod

    I have tried with gcc8 and it downloads gcc and gcc8, but dnf misses all of its dependencies....

    Attempt with my slightly modified dnf

    $ dnf download --forcearch=ppc --repo='AIX_Toolbox_*' --alldeps --resolve gcc-8 gcc8-8.3.0-6
    Last metadata expiration check: 1:01:14 ago on Thu 01 Jun 2023 06:29:48 PM EDT.
    Error in resolve of packages:
        gcc-1:8-1.ppc
        gcc-1:8-1.ppc
        gcc8-8.3.0-6.ppc
        gcc8-8.3.0-6.ppc

     Problem: conflicting requests
      - nothing provides AIX-rpm < 7.3.0.0 needed by gcc-1:8-1.ppc
      - nothing provides AIX-rpm >= 7.2.0.0 needed by gcc-1:8-1.ppc
    Error in resolve of packages:
        gcc-1:8-1.ppc
        gcc-1:8-1.ppc
        gcc8-8.3.0-6.ppc
        gcc8-8.3.0-6.ppc

     Problem: conflicting requests
      - nothing provides AIX-rpm >= 7.1.0.0 needed by gcc-1:8-1.ppc
      - nothing provides AIX-rpm < 7.2.0.0 needed by gcc-1:8-1.ppc
    Error in resolve of packages:
        gcc-1:8-1.ppc
        gcc-1:8-1.ppc
        gcc8-8.3.0-6.ppc
        gcc8-8.3.0-6.ppc

     Problem: conflicting requests
      - nothing provides AIX-rpm < 7.3.0.0 needed by gcc8-8.3.0-6.ppc
      - nothing provides AIX-rpm >= 7.2.0.0 needed by gcc8-8.3.0-6.ppc
      - nothing provides /bin/sh needed by gcc8-8.3.0-6.ppc
      - nothing provides libc.a(shr.o) needed by gcc8-8.3.0-6.ppc
    Error in resolve of packages:
        gcc-1:8-1.ppc
        gcc-1:8-1.ppc
        gcc8-8.3.0-6.ppc
        gcc8-8.3.0-6.ppc

     Problem: conflicting requests
      - nothing provides AIX-rpm >= 7.1.0.0 needed by gcc8-8.3.0-6.ppc
      - nothing provides AIX-rpm < 7.2.0.0 needed by gcc8-8.3.0-6.ppc
      - nothing provides /bin/sh needed by gcc8-8.3.0-6.ppc
      - nothing provides libc.a(shr.o) needed by gcc8-8.3.0-6.ppc
    [SKIPPED] gcc8-8.3.0-6.aix7.2.ppc.rpm: Already downloaded
    [SKIPPED] gcc-8-1.aix7.1.ppc.rpm: Already downloaded

    As you can see here, it does pass and downloads gcc's rpm's, but it misses all of its dependencies...

    [SKIPPED] gcc8-8.3.0-6.aix7.2.ppc.rpm: Already downloaded
    [SKIPPED] gcc-8-1.aix7.1.ppc.rpm: Already downloaded

    (FYI: It says SKIPPED as I already downloaded them, but it will download them if you haven't)

    Solution

    So, it looks like you will have to download them individually. That's what I did and I checked all
    my desired packages dependencies with:


    rpm -qp PACKAGE --requires

    When you install dependencies, you can check what dependencies it will satisfy with:

    rpm -qp PACKAGE --provides

    You can check if you have the required dependencies on your system via

    rpm -qa --provides

    This is handy as AIX-rpm is a big library that provides a lot of dependencies.

    So, I made myself a little script that compared my installed dependencies with the ones provided
    by the rpm's that I want to install. It's actually pretty simple to do.

    Unfortunately, I don't know if I can share the script as I made with while I was working. So, I'd
    have to check with my manager if I can share it publicly.

    Sharing this in case it can help someone.

    My dnf.conf

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

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

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

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

    (sharing as I saw that you have --repo='aix_toolbox'  as a dnf parameter and I don't know
    if you have added all the proper AIX toolbox repositories such as noarch, 7.2, 7.1, ppc and so
    on)



    ------------------------------
    Roberto Arturo Gonzalez Godinez
    ------------------------------



  • 4.  RE: offline downloading aix toolbox packages and all dependencies from a Linux system.

    Posted Mon June 05, 2023 07:47 AM

    Dear,

    I ran into the same problem as you, and there are my solutions.

    A. you can download aix_linux_toolbox ISO/tar to your AIX, then mount it. So you get dnf source locally.

    There is the detail:
    https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2022/02/09/creating-local-repo-with-dnf-and-aix-toolbox-media?CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9

    B. For me, I build a dnf repo in the local network without the internet.
    B1. In the AIX which I need to run dnf, download the dnf_aixtoolbox.sh from 
    https://www.ibm.com/support/pages/node/882892

            and dnf_bundle_aix_71_72.tar(depends on your OS level) from https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/ (this link I found in the dnf_aixtoolbox.sh). Copy these files into /tmp

    B2. edit dnf_aixtoolbox.sh because I can not access the Internet.

          delete lines form 221 to 227:

       if [[ ! -e  dnf_bundle_aix_71_72.tar ]]
       then
           echo "Failed to download dnf_bundle_aix_71_72.tar."
           cd - >/dev/null 2>&1
           rm -rf $tmppath
           exit 1
       fi  

          delete line 250, and add this one:

    #    LDR_CNTRL=MAXDATA=0x80000000@DSA /usr/opt/perl5/bin/lwp-download https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_bundle_aix_71_72.tar
         cp /tmp/dnf_bundle_aix_71_72.tar $tmppath/

    B3. install dnf

    ./dnf_aixtoolbox.sh -y

    B4. change the dnf.conf file to suit to my repo

    aix7.2:root:/>cat /opt/freeware/etc/dnf/dnf.conf
    [AIX_Toolbox]
    name=AIX generic repository
    baseurl=http://192.168.50.190:81/aixyumrepo/RPMS/ppc/
    enabled=1
    gpgcheck=0
    
    [AIX_Toolbox_noarch]
    name=AIX noarch repository
    baseurl=http://192.168.50.190:81/aixyumrepo/RPMS/noarch/
    enabled=1
    gpgcheck=0
    
    [AIX_Toolbox_72]
    name=AIX 7.2 specific repository
    baseurl=http://192.168.50.190:81/aixyumrepo/RPMS/ppc-7.2/
    enabled=1
    gpgcheck=0

    B5. install aix_linux_toolbox repo into an AIX, or Linux(you need to a httpd container). as A.



    ------------------------------
    Wang Xu
    ------------------------------