0

I need to make space in the boot but whatever I try to remove this old kernel returns an error.

Tried to show results from synaptic and apt-get purge

enter image description here

  • 2
    Please don't post screenshots of text. Copy the text here and apply code formatting, instead. – muru Mar 29 '17 at 5:07
2

Try to remove old kernels with this:

dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r) | xargs sudo apt-get -y purge

see: Don't know which kernel to remove to free up disk space

The other errors you get (couldn't lock....) is because you have several applications running who are already created the lock.

| improve this answer | |
  • Thanks Carl, I tried it but the error persist: dpkg: error processing package linux-image-extra-3.13.0-112-generic (--remove): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: linux-image-extra-3.13.0-110-generic linux-image-extra-3.13.0-112-generic N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension E: Sub-process /usr/bin/dpkg returned an error code (1) – alfaRV Mar 29 '17 at 13:21
  • You'll need to remove files manually to hava some space in de boot dir. See: askubuntu.com/questions/171209/… – Carl Mar 29 '17 at 14:32
1

You cannot execute apt-get while synaptic is running.

Also try apt-get autoremove before anything else. On recent Ubuntu it removes most old kernels.

| improve this answer | |
  • Thanks Jean-Marie. I noticed that I had synaptic opened and tried again. the result is on the second screenshot. The error seems to be a broken package – alfaRV Mar 29 '17 at 13:31
0

I created a set of utilities to upgrade (Canonical precompiled), compile from source, and remove kernels.
Note the remove utility will remove all kernels except the current active one.

The scripts can also be called remotely through ssh.

https://github.com/mtompkins/linux-kernel-utilities

| improve this answer | |
  • 1
    Thanks Mark. Tried it but error persist: dpkg: error processing package linux-image-extra-3.13.0-112-generic (--remove): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: linux-image-extra-3.13.0-110-generic linux-image-extra-3.13.0-112-generic N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension E: Sub-process /usr/bin/dpkg returned an error code (1) – alfaRV Mar 29 '17 at 13:34
  • I would try forcing a reinstall of that package linux-image-extra-3.13.0-112-generic with dpkg, rebooting then trying again. If memory serves, dpkg --force-all – Mark Mar 29 '17 at 14:52
0

You need to do the following to take care of at least two of your problems.

1) In terminal:

cd /etc/apt/apt.conf.d  # change directory
ls -al                  # list all files

If 50unattended-upgrades does not exist, we'll rename a file:

sudo mv 50unattended-upgrades.ucf-old 50unattended-upgrades

or if 50unattended-upgrades does exist, we'll delete a file:

sudo rm -i 50unattended-upgrades.ucf-old

2) Your /boot partition is full. You need to delete some older linux kernels/etc there. I personally use Synaptic to do that work for me, but there are other methods that can be used. Search here on askubuntu if you need more help with this.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.