4

sudo apt-get upgrade returns:

Errors were encountered while processing:
 linux-image-4.8.0-39-generic
 linux-image-4.8.0-41-generic
 linux-image-generic
 linux-firmware
 linux-signed-image-4.8.0-39-generic
 linux-image-extra-4.8.0-39-generic
 linux-image-4.8.0-37-generic
 linux-image-extra-4.8.0-37-generic
 linux-signed-image-4.8.0-41-generic
 linux-signed-image-4.8.0-37-generic
 linux-signed-image-generic
 linux-image-extra-4.8.0-41-generic
 linux-generic
 linux-signed-generic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

I saw the related questions but their errors were a little different. I don't know if that's significant.

2

6 Answers 6

4

For me these two lines helped! Just remove all the linux-extra and linux-extra-image files, which are problematic and old.

For each package:

sudo mv /var/lib/dpkg/info/<PACKAGE-NAME>.* /tmp/

Then:

sudo apt-get autoremove && sudo apt-get autoclean

Then install/update the latest linux image file

sudo apt-get install linux-generic
1

I found the problem

apt-get not working on Ubuntu 16.04, problems with kernel packages

It comes from some modifications I had to make to use the Teensy microcontroller

1

It is perfectly possible to have multiple kernels. Since only one is used to boot from the others are automatically inactive. It is an advantage to have multiple kernels in case one fails. I have 4 kernels. Since in your case all kernels fail I suspect your drive or partition is out of space or has not sufficient space left.

1

Tengasui,

You can hardly work several kernels from single Ubuntu OS, so I recommend that you put obsolete versions "on hold".

Like this:

sudo apt-mark hold **package_name**

for example

sudo apt-mark hold linux-image-4.8.0-39-generic

Probably you'll need only the latest kernel linux-image-4.8.0-41-generic and associated linux-firmware.

Try also:

dpkg --configure -a

Having single isolated error you can post and we can more know than brazillion of combinations of errors in dozen variants of kernels.

1
  • Okay, i've held everything but these 3: linux-image-4.8.0-41-generic linux-firmware initramfs-tools when I run dpkg i get the following problem: E: /usr/share/initramfs-tools/hooks/udev failed with return 1. update-initramfs: failed for /boot/initrd.img-4.8.0-41-generic with 1.
    – Chankin
    Mar 16, 2017 at 21:26
0

I had a problem like this, which happened during a fresh install of ubuntu. It happened because my boot partition was too small (100MB), and the installation wasn't able to copy all the files it needed.

FIX: enlarge the boot partition to 200MB, and then reinstall.

0

you sources.list file in /etc/apt/ directory is corrupted please do following things that will do everything for you guys.

//first remove the source.list file don't worry
      rm /etc/apt/sources.list

and then run this command in the terminal

sudo software-properties-gtk 

and this would create a sources.list file automatically. then run this

sudo apt -f install

Best regards ... Mehdi Filban

Not the answer you're looking for? Browse other questions tagged .