- Package:
- crossgrader
- Source:
- crossgrader
- Submitter:
- Paul Muster
- Date:
- 2026-01-30 08:29:02 UTC
- Severity:
- normal
Dear Maintainer, crossgrader is a great and helpful tool. Many thanks for providing it! But what I noticed when removing the package after usage, does makes me quiet unhappy. The initramfs-hook is not removed (or not removed properly) so that update-initramfs fails because of "ModuleNotFoundError: No module named 'debian_crossgrader'".[2] In one case this left a system unbootable because the initrd for a new kernel "delivered" by apticron was not built. When needrestart rebooted the machine it did not come up again. So, coming to the point. As far as I see Debian Policy says "The package’s files are removed (except conffiles)." in 6.8 point 2. Please kindly check whether an increase of severity to 6 serious is appropriate. My expectation is that the hook is implemented in a way so that it can be removed when removing or purging the package crossgrader. Maybe placing it inside of the existing file /usr/share/initramfs-tools/hook-functions[1] is the only way (currently), but then it needs to be removed from there when removing the package. Maybe there are other places, possibly /etc/initramfs-tools/hooks/? [1] # dpkg -S /usr/share/initramfs-tools/hook-functions initramfs-tools-core: /usr/share/initramfs-tools/hook-functions [2] # apt purge arch-test crossgrader dpkg-dev libdpkg-perl make patch python3-appdirs python3-pkg-resources Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: arch-test* crossgrader* dpkg-dev* libdpkg-perl* make* patch* python3-appdirs* python3-pkg-resources* 0 upgraded, 0 newly installed, 8 to remove and 1 not upgraded. After this operation, 7165 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 34876 files and directories currently installed.) Removing crossgrader (0.0.3+nmu3) ... crossgrader data folder did not exist. Removing initramfs binary architecture check hook... Backup file does not exist. Hook could not be removed. package_check data folder did not exist. Removing arch-test (0.20-1) ... Removing dpkg-dev (1.21.22) ... Removing libdpkg-perl (1.21.22) ... Removing make (4.3-4.1) ... Removing patch (2.7.6-7) ... Removing python3-appdirs (1.4.4-3) ... Removing python3-pkg-resources (66.1.1-1+deb12u2) ... Processing triggers for man-db (2.11.2-2) ... (Reading database ... 34196 files and directories currently installed.) Purging configuration files for dpkg-dev (1.21.22) ... # update-initramfs -k all -u update-initramfs: Generating /boot/initrd.img-6.1.0-39-amd64 W: No zstd in /usr/bin:/sbin:/bin, using gzip Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' crossgrader initramfs hook: (WARNING) initramfs binary /sbin/modprobe might not be in the correct architecture. crossgrader initramfs hook: Ensure that it can be executed or crossgrade the package containing it, then update the initramfs again. crossgrader initramfs hook: output of `file /sbin/modprobe`: /sbin/modprobe: symbolic link to /bin/kmod Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' crossgrader initramfs hook: (WARNING) initramfs binary /sbin/rmmod might not be in the correct architecture. crossgrader initramfs hook: Ensure that it can be executed or crossgrade the package containing it, then update the initramfs again. crossgrader initramfs hook: output of `file /sbin/rmmod`: /sbin/rmmod: symbolic link to /bin/kmod Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' crossgrader initramfs hook: (WARNING) initramfs binary /sbin/fsck might not be in the correct architecture. crossgrader initramfs hook: Ensure that it can be executed or crossgrade the package containing it, then update the initramfs again. crossgrader initramfs hook: output of `file /sbin/fsck`: /sbin/fsck: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=7005e32dbe494ef54f1acbbcf23e208ac4607832, for GNU/Linux 3.2.0, stripped Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' crossgrader initramfs hook: (WARNING) initramfs binary /sbin/logsave might not be in the correct architecture. crossgrader initramfs hook: Ensure that it can be executed or crossgrade the package containing it, then update the initramfs again. crossgrader initramfs hook: output of `file /sbin/logsave`: /sbin/logsave: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c58916cc7658b48ff8ed802f59494aea67d74bdc, for GNU/Linux 3.2.0, stripped Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' crossgrader initramfs hook: (WARNING) initramfs binary /sbin/fsck.ext4 might not be in the correct architecture. crossgrader initramfs hook: Ensure that it can be executed or crossgrade the package containing it, then update the initramfs again. crossgrader initramfs hook: output of `file /sbin/fsck.ext4`: /sbin/fsck.ext4: symbolic link to e2fsck Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'debian_crossgrader' E: /usr/share/initramfs-tools/hooks/kmod failed with return 1. update-initramfs: failed for /boot/initrd.img-6.1.0-39-amd64 with 1. # apt install crossgrader Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: arch-test dpkg-dev libdpkg-perl make patch python3-appdirs python3-pkg-resources Suggested packages: qemu-user-static debian-keyring gcc | c-compiler git bzr make-doc diffutils-doc python3-setuptools Recommended packages: build-essential gcc | c-compiler fakeroot libalgorithm-merge-perl libfile-fcntllock-perl The following NEW packages will be installed: arch-test crossgrader dpkg-dev libdpkg-perl make patch python3-appdirs python3-pkg-resources 0 upgraded, 8 newly installed, 0 to remove and 1 not upgraded. Need to get 2821 kB of archives. After this operation, 7165 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://<mirror>/debian bookworm/main amd64 arch-test all 0.20-1 [12.4 kB] Get:2 http://<mirror>/debian bookworm/main amd64 python3-appdirs all 1.4.4-3 [13.0 kB] Get:3 http://<mirror>/debian bookworm/main amd64 python3-pkg-resources all 66.1.1-1+deb12u2 [297 kB] Get:4 http://<mirror>/debian bookworm/main amd64 libdpkg-perl all 1.21.22 [603 kB] Get:5 http://<mirror>/debian bookworm/main amd64 patch amd64 2.7.6-7 [128 kB] Get:6 http://<mirror>/debian bookworm/main amd64 make amd64 4.3-4.1 [396 kB] Get:7 http://<mirror>/debian bookworm/main amd64 dpkg-dev all 1.21.22 [1353 kB] Get:8 http://<mirror>/debian bookworm/main amd64 crossgrader all 0.0.3+nmu3 [18.6 kB] Fetched 2821 kB in 0s (14.9 MB/s) Selecting previously unselected package arch-test. (Reading database ... 34195 files and directories currently installed.) Preparing to unpack .../0-arch-test_0.20-1_all.deb ... Unpacking arch-test (0.20-1) ... Selecting previously unselected package python3-appdirs. Preparing to unpack .../1-python3-appdirs_1.4.4-3_all.deb ... Unpacking python3-appdirs (1.4.4-3) ... Selecting previously unselected package python3-pkg-resources. Preparing to unpack .../2-python3-pkg-resources_66.1.1-1+deb12u2_all.deb ... Unpacking python3-pkg-resources (66.1.1-1+deb12u2) ... Selecting previously unselected package libdpkg-perl. Preparing to unpack .../3-libdpkg-perl_1.21.22_all.deb ... Unpacking libdpkg-perl (1.21.22) ... Selecting previously unselected package patch. Preparing to unpack .../4-patch_2.7.6-7_amd64.deb ... Unpacking patch (2.7.6-7) ... Selecting previously unselected package make. Preparing to unpack .../5-make_4.3-4.1_amd64.deb ... Unpacking make (4.3-4.1) ... Selecting previously unselected package dpkg-dev. Preparing to unpack .../6-dpkg-dev_1.21.22_all.deb ... Unpacking dpkg-dev (1.21.22) ... Selecting previously unselected package crossgrader. Preparing to unpack .../7-crossgrader_0.0.3+nmu3_all.deb ... Unpacking crossgrader (0.0.3+nmu3) ... Setting up python3-pkg-resources (66.1.1-1+deb12u2) ... Setting up make (4.3-4.1) ... Setting up patch (2.7.6-7) ... Setting up libdpkg-perl (1.21.22) ... Setting up arch-test (0.20-1) ... Setting up python3-appdirs (1.4.4-3) ... Setting up dpkg-dev (1.21.22) ... Setting up crossgrader (0.0.3+nmu3) ... Processing triggers for man-db (2.11.2-2) ... Scanning processes... Scanning processor microcode... Scanning linux images... Running kernel seems to be up-to-date. The processor microcode seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host. # update-initramfs -k all -u update-initramfs: Generating /boot/initrd.img-6.1.0-39-amd64 W: No zstd in /usr/bin:/sbin:/bin, using gzip update-initramfs: Generating /boot/initrd.img-6.1.0-35-amd64 W: No zstd in /usr/bin:/sbin:/bin, using gzip #
Thanks, and also confirmed on version 0.0.3+nmu3,
I ran across same within the past 24 hours.
Haven't fully tested, but looks like issue is likely also present in
versions 0.0.3+nmu4 and 0.0.3+nmu5
and may also be present in versions prior to 0.0.3+nmu3 (I haven't
specifically looked there).
I'm not exactly a python developer (yet?), but my quick peek,
looks like the issue comes from
./usr/lib/python3/dist-packages/debian_crossgrader/crossgrader.py
in the crossgrader package.
It appears slightly changed from
0.0.3+nmu3 to 0.0.3+nmu4
but I'm guestimating those changes make no difference to this bug,
and those files precisely match between
0.0.3+nmu4 and 0.0.3+nmu5
# diff -U 0 0.0.3+nmu{3,4}/usr/lib/python3/dist-packages/debian_crossgrader/crossgrader.py
--- 0.0.3+nmu3/usr/lib/python3/dist-packages/debian_crossgrader/crossgrader.py
2020-09-06 16:13:29.000000000 +0000
+++ 0.0.3+nmu4/usr/lib/python3/dist-packages/debian_crossgrader/crossgrader.py
2024-09-22 16:47:41.000000000 +0000
@@ -22 +21,0 @@
-import appdirs
@@ -23,0 +23 @@
+import platformdirs
@@ -97 +97 @@
- storage_dir = appdirs.site_data_dir(APP_NAME)
+ storage_dir = platformdirs.site_data_dir(APP_NAME)
# cmp 0.0.3+nmu{4,5}/usr/lib/python3/dist-packages/debian_crossgrader/crossgrader.py
&& echo IDENTICAL
IDENTICAL
#
And good and I think quite fitting that severity is important, as
the bug causes crossgrader to break other package(s),
notably it alters
/usr/share/initramfs-tools/hook-functions
belonging to
initramfs-tools-core
and furthermore:
through use of crossgrader's customary steps, including cleanup
and removal/purge, it never sets
/usr/share/initramfs-tools/hook-functions
back as it was before, even after remove/purge of crossgrader,
thus leaving
/usr/share/initramfs-tools/hook-functions
effectively broken by crossgrader once crossgrader is removed,
as crossgrader's changes to
/usr/share/initramfs-tools/hook-functions
render it dependent upon crossgrader.
I think that well warrants severity of important.
However, as a practical matter, I think for the most part those
that are doing crossgrading operations with crossgrader,
generally will (or ought) have the skills to identify and remedy such
issues, so probably not a huge deal.
And with this bug, and notes on it,
and what I've added on
https://wiki.debian.org/CrossGrading
finding information on the issue and dealing with it (effective
work-arounds) should also now be all that much easier.
And, did analyze a bit further, mere installation of crossgrader doesn't alter
/usr/share/initramfs-tools/hook-functions
however even the mere first stage dry run, e.g.:
# crossgrader --dry-run amd64
caused crossgrader to (quite unexpectedly at that!) alter
/usr/share/initramfs-tools/hook-functions
I'd presume the way crossgrader ought handle that, would be to place
it's own config file under /etc in appropriate location for
initramfs customizations, and after removal of crossgrader I'm presuming
that should still remain, but it should then be or be rendered harmless,
such that it doesn't or no longer depends upon crossgrader being
installed, and harmlessly does nothing if crossgrader isn't installed,
and that a purge of crossgrader would remove such file.
Work-arounds:
restore the earlier
/usr/share/initramfs-tools/hook-functions
That can also be accomplished by (re)installing the
initramfs-tools-core
package, e.g.:
# apt-get --reinstall install initramfs-tools-core
Additionally, in the interim, various Debian packages may have
gotten into various semi-broken states, most notably failed
during configuration, on account of the bug.
That can then generally be remedied, after fixing the above, by, e.g.:
# dpkg --configure -a
Wiki: in not necessarily any particular order, I've added some
quite relevant bits that should be helpful for those that do
or may encounter this bug, most notably on:
https://wiki.debian.org/CrossGrading
added:
https://wiki.debian.org/CrossGrading#bug-1114664-crossgrader-initramfs-tools-core
which well covers bug and work-around in section (using crossgrader):
Third (optional) stage and additional recommended/suggested cleanup
https://wiki.debian.org/CrossGrading#Third_.28optional.29_stage_and_additional_recommended.2Fsuggested_cleanup
And also added bit more of relevance in section
Recommended: specific files/state backup
https://wiki.debian.org/CrossGrading#Third_.28optional.29_stage_and_additional_recommended.2Fsuggested_cleanup
(notably suggesting first saving a copy of the file if one will or may
be using crossgrader)
Versions:
I ran into this on Debian 12.13 with crossgrader version 0.0.3+nmu3
Ran into the bug crossgrading from amd64 to i386 (egad, I ran into
another use case for that), and likewise also confirmed same bug
crossgrading from i386 to amd64. Also, examining the contents of
versions 0.0.3+nmu4 and 0.0.3+nmu5 seems to me probable that same bug
is also still present in those versions (though I didn't explicitly
test/run those).
Some specific diagnostic excerpts when bug is triggered - may help
folks also find this, e.g. via search engines, e.g.:
# apt-get -y install linux-image-6.1.0-42-686-pae
...
ModuleNotFoundError: No module named 'debian_crossgrader'
crossgrader initramfs hook: (WARNING) initramfs binary /sbin/modprobe
might not be in the correct architecture.
crossgrader initramfs hook: Ensure that it can be executed or
crossgrade the package containing it, then update the initramfs again.
crossgrader initramfs hook: output of `file /sbin/modprobe`:
...
most of the rest of the diagnostics are either pretty ordinary or
mostly redundant. The most telling bits are the references to
crossgrade, crossgrader, and debian_crossgrader after the crossgrade
package has been purged.
And much thanks for all Debian's fabulous work on all this!
And yes, severity: Important, but given context, (increasing)
information available,
work-arounds, etc., probably not a huge deal, but of course other
thoughts, opinions, evaluations may very well reasonably differ on
that.