I'm working on a Redhat Ubi8-minimal Container. My goal is to install an .rpm from file together with its dependencies. Ubi8-minimal only provides microdnf which cannot install local .rpm's. So I installed yum using microdnf install yum which runs through fine. Among the output it shows that libmodulemd is being updated:
Updating: libmodulemd;2.13.0-2.fc34;x86_64;Clients_Fedora_34_Fedora_34_Updates
But with the first invocation of yum I get:
[root@7fc9c0e586b1]# yum --version
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.9/site-packages/dnf/__init__.py", line 30, in <module>
import dnf.base
File "/usr/lib/python3.9/site-packages/dnf/base.py", line 29, in <module>
import libdnf.transaction
File "/usr/lib64/python3.9/site-packages/libdnf/__init__.py", line 12, in <module>
from . import conf
File "/usr/lib64/python3.9/site-packages/libdnf/conf.py", line 13, in <module>
from . import _conf
ImportError: /lib64/libmodulemd.so.2: undefined symbol: g_ptr_array_extend_and_steal
After that microdnf too has this problem and is no longer usable:
[root@7fc9c0e586b1]# microdnf --version
microdnf: symbol lookup error: /lib64/libmodulemd.so.2: undefined symbol: g_ptr_array_extend_and_steal
so I cannot manage any packages and installations anymore.
How can I fix this and get yum to work on Ubi8?
Details
Here is what I find in a fresh container after running podman --it --rm docker.io/redhat/ubi8-minimal bash
/etc/yum.repos.d/ubi.repo
Here is the contents of /etc/yum.repos.d/ubi.repo.
[ubi-8-baseos]
name = Red Hat Universal Base Image 8 (RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-baseos-debug]
name = Red Hat Universal Base Image 8 (Debug RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-baseos-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - BaseOS
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-appstream]
name = Red Hat Universal Base Image 8 (RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-appstream-debug]
name = Red Hat Universal Base Image 8 (Debug RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-appstream-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - AppStream
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-codeready-builder]
name = Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/os
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-codeready-builder-debug]
name = Red Hat Universal Base Image 8 (Debug RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/debug
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[ubi-8-codeready-builder-source]
name = Red Hat Universal Base Image 8 (Source RPMs) - CodeReady Builder
baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/codeready-builder/source/SRPMS
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
gpgcheck = 1
This is also the only .repo file in the directory. I have not actively enabled any other repos.
microdnf repolist --enabled
Here is the output of the microdnf repolist --enabled command.
repo id repo name
Clients_Extra-Software_Fedora Fedora
Clients_Fedora_34_Fedora_34_Everything Fedora 34 Everything
Clients_Fedora_34_Fedora_34_Updates Fedora 34 Updates
Clients_RPM_Fusion_Fedora_34_RPM_Fusion_Free_OS RPM Fusion Free OS 34
Clients_RPM_Fusion_Fedora_34_RPM_Fusion_Free_Updates RPM Fusion Free Updates 34
Clients_RPM_Fusion_Fedora_34_RPM_Fusion_Nonfree_OS RPM Fusion Nonfree OS 34
Clients_RPM_Fusion_Fedora_34_RPM_Fusion_Nonfree_Updates RPM Fusion Nonfree Updates 34
Clients_Trinity_Desktop_Environment_Fedora_34_Trinity_Desktop_Environment_Fedora_34_noarch Trinity Desktop Environment Fedora 34 noarch
Clients_Trinity_Desktop_Environment_Fedora_34_Trinity_Desktop_Environment_Fedora_34_x86_64 Trinity Desktop Environment Fedora 34 x86_64
ubi-8-appstream Red Hat Universal Base Image 8 (RPMs) - AppStream
ubi-8-baseos Red Hat Universal Base Image 8 (RPMs) - BaseOS
ubi-8-codeready-builder Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder
Which is quite confusing to me, as it doesn't match the contents of ubi.repo.