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
------------------------------
Original Message:
Sent: Fri May 26, 2023 11:22 AM
From: Mario Garcia
Subject: offline downloading aix toolbox packages and all dependencies from a Linux system.
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 cur
l 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
------------------------------