NOTE: Je doute que cette question soit un doublon de this car je n’utilise pas DKMS
Bonjour, sur mon serveur (récemment restauré à partir d’un problème de noyau horrible), apt autoremove --purge
donne ce résultat:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-extra-4.8.0-59-generic
0 upgraded, 0 newly installed, 1 to remove and 36 not upgraded.
2 not fully installed or removed.
After this operation, 161 MB disk space will be freed.
(Reading database ... 264820 files and directories currently installed.)
Removing linux-image-extra-4.8.0-59-generic (4.8.0-59.64) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-59-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-59-generic /boot/vmlinuz-4.8.0-59-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-59-generic /boot/vmlinuz-4.8.0-59-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-59-generic
cp: failed to restore the default file creation context: Invalid argument
E: /usr/share/initramfs-tools/hooks/kmod failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.0-59-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.8.0-59-generic (--remove):
installed linux-image-extra-4.8.0-59-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.8.0-59-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Une ligne d'intérêt ici est la suivante:
depmod: FATAL: could not load /boot/System.map-4.8.0-59-generic: No such file or directory
ls /boot
:
0 LD-Server /etc/update-motd.d ls /boot
abi-4.15.0-42-generic grub/ System.map-4.15.0-42-generic vmlinuz-4.15.0-43-generic
config-4.15.0-42-generic initrd.img-4.15.0-42-generic System.map-4.15.0-43-generic
config-4.15.0-43-generic retpoline-4.15.0-42-generic vmlinuz-4.15.0-42-generic
Je vois un System.map-4.15.0-42-generic
et System.map-4.15.0-43-generic
mais pas System.map-4.8.0-59-generic
...
Mon serveur semble bien démarrer (il fonctionne maintenant, après tout), mais je n'ai pas vraiment envie de le tester maintenant ... Y a-t-il un moyen de résoudre ce problème?
C'est un bogue initramfs-tools
ouvert dans ce lien: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1776652
Dans ce cas spécifique, il a été déclenché par une ligne défectueuse dans /usr/share/initramfs-tools/hooks/kmod
#!/bin/sh -e
# Copy the compatibility symlinks until initramfs-tools will be converted
# to use the kmod program.
if [ "$1" = "prereqs" ]; then exit 0; fi
. /usr/share/initramfs-tools/hook-functions
copy_exec /bin/kmod
cp -a /sbin/modprobe /sbin/rmmod $DESTDIR/sbin/
mkdir -p $DESTDIR/lib/modprobe.d/
if [ "$(echo /lib/modprobe.d/*)" != "/lib/modprobe.d/*" ]; then
cp -a /lib/modprobe.d/* $DESTDIR/lib/modprobe.d/
fi
Commenter la ligne
#cp -a /sbin/modprobe /sbin/rmmod $DESTDIR/sbin/
astuces update-initramfs
pour ignorer l'erreur.