-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q: After first use dnf with installroot - no show list installed #2022
Comments
Hi, at first glance, I don't see a reason why dnf shouldn't display the installed packages.
At this point, could you try running |
Could you test it out, here's an case ? # Create container
dnf install \
--releasever=9 --nodocs -4 --assumeyes \
--installroot=/var/lib/machines/oel9.home.lab \
--setopt=install_weak_deps=False --nogpgcheck \
--setopt=module_platform_id=platform:el9 \
--repofrompath=ol9_baseos_latest,"https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64" \
oraclelinux-release-el9 systemd systemd-udev systemd-container initscripts \
openssl passwd glibc-langpack-en dnf iproute iputils net-tools tree nano \
lsof hostname unzip tzdata basesystem ca-certificates tar file \
filesystem less
# Set password for root
systemd-nspawn -D /var/lib/machines/oel9.home.lab passwd
# Boot container
systemd-nspawn -b -D /var/lib/machines/oel9.home.lab
# Login and run
dnf list installed --releasever=9 In fresh created container, dnf - not listed installed packages |
I've tried to replicate the issue in the Fedora Rawhide VM as the host system. I've needed to add a
|
Perhaps one of us is doing something wrong. For the sake of the experiment, let's take a third-party image from https://hub.nspawn.org/images/. So, let's try it: # Import keys
gpg --no-default-keyring \
--keyring=/etc/systemd/import-pubring.gpg \
--fingerprint
gpg --no-default-keyring \
--keyserver=keys.openpgp.org \
--keyring=/etc/systemd/import-pubring.gpg \
--search 9E31BD4963FC2D19815FA7180E2A1E4B25A425F6
# Import the image
machinectl pull-tar https://hub.nspawn.org/storage/debian/sid/tar/image.tar.xz debsid.home.lab
# set root password
systemd-nspawn -D /var/lib/machines/debsid.home.lab passwd
# start our container
systemd-nspawn --resolv-conf=bind-host -b -D /var/lib/machines/debsid.home.lab
# Install the necessary packages in the freshly created container
apt update && apt install -y dnf systemd-container
# Let's install Fedora 40
# Create the necessary folder
mkdir -p /var/lib/machines/f40.home.lab/
# fix invocation environment
cd /
for i in proc sys dev; do mkdir /var/lib/machines/f40.home.lab/$i;done
for i in proc sys dev; do mount -o bind $i /var/lib/machines/f40.home.lab/$i; done
dnf install passwd dnf fedora-release util-linux systemd \
--installroot=/var/lib/machines/f40.home.lab \
--nogpgcheck --releasever=40 \
--setopt=install_weak_deps=False \
--assumeyes -4 --nodocs --forcearch=x86_64 \
--repofrompath=fedora40,"https://ask4.mm.fcix.net/fedora/linux/development/rawhide/Everything/x86_64/os/"
#
for i in proc sys dev; do umount /var/lib/machines/f40.home.lab/$i; done
# Try to get a list of installed packages
systemd-nspawn -D /var/lib/machines/f40.home.lab dnf list --installed --releasever=40
#
chroot /var/lib/machines/f40.home.lab
dnf list --installed --releasever=40 I don't see any installed packages ... I have to reinstall all the packages, only then I get a list of installed packages # Again install
systemd-nspawn -D /var/lib/machines/f40.home.lab dnf install --releasever=40 -y passwd dnf fedora-release util-linux systemd
# Returns a list of installed packages
systemd-nspawn -D /var/lib/machines/f40.home.lab dnf list --installed --releasever=40 |
Sorry, but this is too complex for testing. We need a simple reproducer to analyse the potential issue. In the first OL9 example, have you tried running the |
I just ran into this issue. (I'll assume the root cause is the same) The problem is that host's Simply running "find <path_to_installroot> -name rpmdb.sqlite" should give you the path host's |
Thanks! I was at the same problem for some hours until this solved it. In my case it was placed in |
In my case:
On Debian trixie, i build a minimal Oracle Linux 9 distribution in a container.
dnf install oraclelinux-release-el9 dnf \ --releasever=9 --nodocs -4 --assumeyes \ --installroot=/var/lib/machines/oel9.home.lab \ --setopt=install_weak_deps=False --nogpgcheck \ --setopt=module_platform_id=platform:el9 \ --repofrompath=ol9_baseos_latest,"https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64"
After dnf install completed, i run
dnf not show list of installed packages.
I need again re-install my installed packages.
When it is done, dnf will show the list of installed packages.
Is it possible to avoid this?
The text was updated successfully, but these errors were encountered: