I need to make space in the boot but whatever I try to remove this old kernel returns an error.
4 Answers
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.
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.
- 2,018
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.
- 1,531
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.
- 73,649

