0

I am trying to upgrade my Ubuntu 16.04 on a VM VirtualBox. But when running the following code:

sudo apt-get upgrade

I am receiving the following error message:

 (Reading database ... 248247 files and directories currently
 installed.) Removing linux-image-extra-4.4.0-109-generic
 (4.4.0-109.132) ... run-parts: executing
 /etc/kernel/postinst.d/apt-auto-removal 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic run-parts: executing
 /etc/kernel/postinst.d/initramfs-tools 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic update-initramfs: Generating
 /boot/initrd.img-4.4.0-109-generic run-parts: executing
 /etc/kernel/postinst.d/pm-utils 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic run-parts: executing
 /etc/kernel/postinst.d/unattended-upgrades 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic run-parts: executing
 /etc/kernel/postinst.d/update-notifier 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic run-parts: executing
 /etc/kernel/postinst.d/vboxadd 4.4.0-109-generic
 /boot/vmlinuz-4.4.0-109-generic run-parts: failed to exec
 /etc/kernel/postinst.d/vboxadd: Exec format error run-parts:
 /etc/kernel/postinst.d/vboxadd exited with return code 1 dpkg: error
 processing package linux-image-extra-4.4.0-109-generic (--remove): 
 subprocess installed post-removal script returned error exit status 1
 Errors were encountered while processing: 
 linux-image-extra-4.4.0-109-generic E: Sub-process /usr/bin/dpkg
 returned an error code (1)

I do not know how to fix the configuration files of 109 files. But here is the output of uname -r:

4.4.0-116-generic

And here is a full list of available versions when running dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)

 ri  linux-image-4.4.0-109-generic               4.4.0-109.132         
 amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP

 ii  linux-image-4.4.0-112-generic               4.4.0-112.135         
 amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP

I cannot seem to find a solution in this website as it seems I am making the problem more severe by incorrect application of the solutions. Your help in fixing my machine is greatly appreciated.

stumblebee
  • 3,547
Rebel
  • 113
  • 10

1 Answers1

0

According to this post (Apt fails to remove partially installed kernel and can't install any other packages),

  1. I created a back up of the status file in case something goes wrong:

    sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.backup

  2. I opened /var/lib/dpkg/status with gedit and searched and deleted ONLY the references of the broken packages. Here is the code to verify such packages: (the status will tell you if they area really broken):

    dpkg --status linux-image-4.4.0-109-generic

    dpkg --status linux-image-extra-4.4.0-109-generic

  3. I ran sudo apt-get update and sudo apt-get upgrade to make sure that issues are fixed.

Rebel
  • 113
  • 10