pmbootstrap init fails on Debian, complaining about missing "kpartx" and "losetup"
In Debian "Bookworm" (current stable) command pmbootstrap init
fails with "ERROR: Can't find all programm required to run pmbootstrap. Pleas install the following: kpartx, losetup". Looks like the message was introduced by commit e0a2fbf2.
The binaries "kpartx" and "losetup" are installed in /usr/sbin
. They are not accessible by unprivileged user (correction: by full path they are, see further down). Accessibility can be tested by kpartx --help
and losetup --help
or sudo kpartx --help
and sudo losetup --help
respectively.
Usage of pmbootstrap init
on Debian "Bookworm" was no problem before. Probably these binaries come to use after pmbootsrap asks for sudo, I don't know. Now they get checked at a very early stage of pmbootstrap where no sudo is active.
On Linux Mint 22 "Wilma" (based on Ubuntu 24.04 LTS "Noble Numbat") the issue doesn't occur, eventhough the binaries "kpartx" and "losetup" are installed in /usr/sbin
as well.
Looking for the differences between Debian "Bookworm" and Linux Mint 22 "Wilma" I couldn't (edit: fixed typo "could" -> "couldn't") see an obvious difference in the sudoers file and neither in the access rights of /usr/sbin
and its files.
I realized that using full path /usr/sbin/losetup --help
and /usr/sbin/kpartx --help
works for unpriviledged user.
There are two more files /usr/share/bash-completion/completions/losetup
and /usr/lib/klibc/bin/losetup
. But so far I couldn't spot a difference between Debian "Bookworm" and Linux Mint 22 "Wilma" on those two.
I don't know where the wrapping from "losetup" to "/usr/sbin/losetup" is done.