0

I want to free up some of the space in /boot but i am not able to do so.

Filesystem            1K-blocks     Used Available Use% Mounted on
/dev/sda1                474730   463590         0 100% /boot

I have tried sudo apt-get autoremove --purge but following error

sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
linux-image-extra-4.4.0-137-generic : Depends: linux-image-4.4.0-137-generic but it is not installed
 linux-image-extra-4.4.0-142-generic : Depends: linux-image-4.4.0-142-generic but it is not installed
 linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not installed
                   Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.

I have tried sudo apt-get -f install but due to no empty space, I am not able to successfully run it and getting the following error

Unpacking linux-image-4.4.0-137-generic (4.4.0-137.163) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0- 
137-generic_4.4.0-137.163_amd64.deb (--unpack):
cannot copy extracted data for './boot/abi-4.4.0-137-generic' to '/boot/abi- 
4.4.0-137-generic.dpkg-new': failed to write (No space left on device)

I also tried to remove it using dpkg with the following code

dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge

I got the following error for the above command.

root@servername:/# dpkg --list | grep linux-image | awk '{ print $2 }' | 
sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-extra-4.4.0-112-generic : Depends: linux-image-4.4.0-112-generic 
but it is not going to be installed
linux-image-extra-4.4.0-116-generic : Depends: linux-image-4.4.0-116-generic 
but it is not going to be installed
linux-image-extra-4.4.0-119-generic : Depends: linux-image-4.4.0-119-generic 
but it is not going to be installed
linux-image-extra-4.4.0-121-generic : Depends: linux-image-4.4.0-121-generic 
but it is not going to be installed
linux-image-extra-4.4.0-124-generic : Depends: linux-image-4.4.0-124-generic 
but it is not going to be installed
linux-image-extra-4.4.0-127-generic : Depends: linux-image-4.4.0-127-generic 
but it is not going to be installed
linux-image-extra-4.4.0-128-generic : Depends: linux-image-4.4.0-128-generic 
but it is not going to be installed
linux-image-extra-4.4.0-21-generic : Depends: linux-image-4.4.0-21-generic 
but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not 
going to be installed
                   Depends: linux-image-extra-4.4.0-142-generic but it is not going to be installed
                   Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I tried removing old kernels one by one but still no luck

root@servername:/# sudo apt-get purge linux-image-4.4.0-112-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-extra-4.4.0-112-generic : Depends: linux-image-4.4.0-112-generic 
but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not 
going to be installed
                   Depends: linux-image-extra-4.4.0-142-generic but it is 
not going to be installed
                   Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I also tried with sudo rm -rf /boot/*-34.4.0-{112,116,119,121,124,127,128,21}-* but still no luck.

Does anyone knows how to resolve it?

Thanks in advance.

1 Answers1

2

The only solution is to remove these manually, it would be the first time that rm -rf is not working. Your conditions is not matching probably.

sudo rm -rf /boot/*-4.4.0-{112,116,119,121,124,127,128,21}-*
Alpy
  • 565