3

When I try using the apt command, it runs into errors.

For example, running:

sudo apt-get autoremove

results in this wall of error messages:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.4.0-45-generic linux-image-extra-4.4.0-45-generic linux-image-extra-4.4.0-51-generic
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 379 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 384651 files and directories currently installed.)
Removing linux-image-extra-4.4.0-45-generic (4.4.0-45.66) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-45-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
WARNING: missing /lib/modules/4.4.0-45-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-45-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_vrF46u/lib/modules/4.4.0-45-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_vrF46u/lib/modules/4.4.0-45-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d  
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-45-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-45-generic (4.4.0-45.66) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-45-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d  
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-45-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-45-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-51-generic (4.4.0-51.72) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d  
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-51-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-45-generic
 linux-image-4.4.0-45-generic
 linux-image-extra-4.4.0-51-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried running

  • sudo apt-get -f install
  • sudo dpkg --configure -a
  • sudo apt autoremove
  • sudo apt full-upgrade

and I get similar or the same error for all of them. The only one that has a different error is the sudo dpkg --configure -a command, which results in

Setting up linux-image-4.4.0-51-generic (4.4.0-51.72) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-4.4.0-51-generic
) points to /boot/initrd.img-4.4.0-51-generic
 (/boot/initrd.img-4.4.0-51-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-4.4.0-51-generic
) points to /boot/vmlinuz-4.4.0-51-generic
 (/boot/vmlinuz-4.4.0-51-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d  
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-51-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-signed-image-4.4.0-51-generic:
 linux-signed-image-4.4.0-51-generic depends on linux-image-4.4.0-51-generic (= 4.4.0-51.72); however:
  Package linux-image-4.4.0-51-generic is not configured yet.

dpkg: error processing package linux-signed-image-4.4.0-51-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-51-generic
 linux-signed-image-4.4.0-51-generic

For reference purposes, the output of uname -a is:

Linux ubuntu 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Is there any way I can salvage the package system?

yeedle
  • 131
  • I got a similar problem, my error log is here: – Clock ZHONG Dec 26 '16 at 01:31
  • In the logs the "paste" command does not recognizes "-s" and "-d" options, and because of this error the kernel install and upgrade scripts are broken. Please verify if the package "coreutils" (where the paste command is located) is the correct one for your system and the kernel packages. To verify which version of "coreutils" package:

    apt-cache policy coreutils

    After that try to download and install manually the correct package version of "coreutils" with dpkg and then try again the kernel upgrade.

    A link about checking the version of coreutils: http://askubuntu.com/a/696280/566214

    – Rui Bernardo Jan 05 '17 at 19:04

0 Answers0