#996596 [linux-image-amd64] dkms error on kernel image removal

Package:
dkms
Source:
dkms
Submitter:
Lyndon Brown
Date:
2022-05-30 01:09:24 UTC
Severity:
important
Tags:
#996596#5
Date:
2021-10-15 21:35:44 UTC
From:
To:
I tried to purge linux-image-5.14.0-1-amd64 yesterday and ran into an
error. I additionally tried to purge linux-image-5.14.0-2-amd64 today
following the release of linux-image-5.14.0-3-amd64 and ran into the
same error, which I've copied below.

Please can you advise how to clean up after the failure, is removal of
the old '/lib/modules/5.14.0-x-amd64' directories and their contents
sufficient?

$ sudo dpkg --purge linux-image-5.14.0-2-amd64
(Reading database ... 274461 files and directories currently installed.)
Removing linux-image-5.14.0-2-amd64 (5.14.9-2) ...
/etc/kernel/prerm.d/dkms:
dkms: removing:   (5.14.0-2-amd64) (x86_64)
Error! Arguments <module> and <module-version> are not specified.
Usage: remove <module>/<module-version> or
       remove -m <module>/<module-version> or
       remove -m <module> -v <module-version>
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.14.0-3-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-5.14.0-3-amd64
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.14.0-2-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.14.0-3-amd64
Found initrd image: /boot/initrd.img-5.14.0-3-amd64
Adding boot menu entry for EFI firmware configuration
done
Purging configuration files for linux-image-5.14.0-2-amd64 (5.14.9-2) ...
rmdir: failed to remove '/lib/modules/5.14.0-2-amd64': Directory not empty
dpkg: warning: while removing linux-image-5.14.0-2-amd64, directory '/lib/modules/5.14.0-2-amd64' not empty so not removed

#996596#24
Date:
2021-12-06 19:44:12 UTC
From:
To:
patch to fix:
--- dkms.bak    2021-10-01 11:34:34.000000000 +0200
+++ dkms        2021-12-06 20:40:15.879443636 +0100
@@ -13,8 +13,8 @@

 if [ -x /usr/sbin/dkms ]; then
 while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'` | cut -d'/' -f1
-   vers=`echo "$line" | awk '{print $1}' | sed 's/,$//'` | cut -d'/' -f2
+   name=`echo "$line" | awk '{print $1}' | sed 's/,$//' | cut -d'/' -f1`
+   vers=`echo "$line" | awk '{print $1}' | sed 's/,$//' | cut -d'/' -f2`
    arch=`echo "$line" | awk '{print $3}' | sed 's/:$//'`
    echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
    dkms remove -m $name -v $vers -k $inst_kern -a $arch

#996596#25
Date:
2022-04-07 10:19:01 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
dkms, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 996104@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gianfranco Costamagna <locutusofborg@debian.org> (supplier of updated dkms package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 07 Apr 2022 12:08:47 +0200
Source: dkms
Architecture: source
Version: 3.0.3-1
Distribution: unstable
Urgency: low
Maintainer: Dynamic Kernel Modules Support Team <dkms@packages.debian.org>
Changed-By: Gianfranco Costamagna <locutusofborg@debian.org>
Closes: 945594 996104 996648 1005812
Changes:
 dkms (3.0.3-1) unstable; urgency=low
 .
   * New upstream version 3.0.3 (Closes: #996104, Closes: #1005812, Closes: #996648)
   * Drop examples removed upstream
   * Drop patches now part of upstream codebase:
     - 149.patch
     - do-not-load-modules.patch
   * Refresh export-CC patch
 .
   [ Andreas Beckmann ]
   * dkms-autopkgtest: If no linux-headers-* packages are installed, install
     all available ones before building modules. (Closes: #945594)
   * improve verbosity
Checksums-Sha1:
 00cca3809d9f619497b2dbb3a52f8bf77eb79177 1964 dkms_3.0.3-1.dsc
 0750d7f144ed4630648505464def4cbbbdd66837 55716 dkms_3.0.3.orig.tar.gz
 9133a1aef7af6ea21baac834ea6ad22f507b50fa 20088 dkms_3.0.3-1.debian.tar.xz
 dd71476969fa88a4d80f8675b7397c3d380e6ff0 7216 dkms_3.0.3-1_source.buildinfo
Checksums-Sha256:
 8cb54effec685f68863394ee705ce3af90452f7daf01d02e9b8437fbb8cb5eef 1964 dkms_3.0.3-1.dsc
 89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d 55716 dkms_3.0.3.orig.tar.gz
 86ad67f54d7ba3c853d0c9d1e9e89d0c9e68e53430c22f01dfd5195f418f8a37 20088 dkms_3.0.3-1.debian.tar.xz
 649c53affc424bf2ea7f3082a228b6821ecec57fb83ccc5748b69ce07d00981d 7216 dkms_3.0.3-1_source.buildinfo
Files:
 038226c2dd5225b863af972cdc358fb4 1964 kernel optional dkms_3.0.3-1.dsc
 793cea9e7574c1eea006a04b65cfd807 55716 kernel optional dkms_3.0.3.orig.tar.gz
 ddeaa49c16362b05631069e92992f9c9 20088 kernel optional dkms_3.0.3-1.debian.tar.xz
 489617d4cb0f3c532c081e169c4e7d1b 7216 kernel optional dkms_3.0.3-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEkpeKbhleSSGCX3/w808JdE6fXdkFAmJOuT8ACgkQ808JdE6f
XdkP1BAAhI1SY/VCGVlUtMT2oDResiGzuE6nAY/OubjO5DsBwntUvrWtP6Y28AqM
X1xflu4SGfPygijOBVNKgo1/W5W38FkniYcGFUcT3NjPAhlcclwdLM2KhCg+Qnrv
LUZecMqjItKLyJWKIWOzwWy40o26kHpTqLHld2DXYfNNVhLle8BQBiFFXapd27ce
mL0SzadNAMkxipRUxz5GzryfjHILSgqa7nGA6d+yeTrqjdCgcsSUhXfmrRQR07Hk
CrbIKehRLKDLRxKxaYUo8yWhWi3jlY/hWErrBfV8xMTUaLxaB48AAWHQUJpnnAQ0
6Ckx2UmK7qH73fAMYVm3KcFbeCj3aEBEIj+3CGpdfOM1r1Vl8RI3MUCOnaLEhpL/
G3299vgtEbc5VTVIdKOBZEhcN/WK/1y4Z0r5cuCwM7KhQkRwmzXcM1ESZ6bD1Mdf
vuNupsGNh57XDloEwX/X8C74MIOPJAKj5BYUsVYZDvPnWnz32zpIirEwCqdW7R3C
8UXgtlOi2Yii9Nr+iSDn7dJs1rPSMeHbOBAbOYtYD/dfUWymEhKfZuCaqR00vfn7
chWAfHvTDWU2alfJW/sy3j6iAQHx9f5p4CgornJ+T4ighrBhJgprZm9bwKJbFJpD
abndYwvMPfPSmcClaYTioum6g72IiuNt4pgcdmUXrXti2sAG8Ng=
=p8IA
-----END PGP SIGNATURE-----