2

I get errors when trying to remove some old packages:

per@pyraohms:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-extra-4.13.0-16-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 163 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 346761 files and directories currently installed.)
Removing linux-image-extra-4.13.0-16-generic (4.13.0-16.19) ...
depmod: FATAL: could not load /boot/System.map-4.13.0-16-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-16-generic /boot/vmlinuz-4.13.0-16-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-16-generic /boot/vmlinuz-4.13.0-16-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-16-generic
WARNING: missing /lib/modules/4.13.0-16-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.13.0-16-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
W: plymouth module (/usr/lib/x86_64-linux-gnu/plymouth//.so) missing, skipping that theme.
depmod: WARNING: could not open /var/tmp/mkinitramfs_V8ELWC/lib/modules/4.13.0-16-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_V8ELWC/lib/modules/4.13.0-16-generic/modules.builtin: No such file or directory
/usr/sbin/update-initramfs: 174: /usr/sbin/update-initramfs: sync: not found
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-4.13.0-16-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.13.0-16-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Does anyone know what seems to be the problem here?

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • have you tried sudo dpkg --purge linux-image-extra-4.13.0-16-generic – John Orion Dec 11 '17 at 19:14
  • Could you please try to reinstall the packages providing /usr/sbin/update-initramfs and /bin/sync, i. e. coreutils and initramfs-tools and then report back with the results? I suspect that either was corrupted. You can do with sudo apt-get install -f --reinstall coreutils initramfs-tools. Thanks. – David Foerster Dec 11 '17 at 19:32
  • Possible duplicate of https://askubuntu.com/questions/986300/boot-100-full-i-have-tried-removing-unused-kernels with a possibly nice (or even great) answer by "user535733". – tuk0z Dec 14 '17 at 19:28

0 Answers0