0

I have an upgrade install of Ubuntu 16.04.1 which will not load the desktop, when I attempt some of the solutions I get an error gzip: stdout: No space left on device. My /boot partition is 449 MB and has many old kernel versions. I am currently using a Live CD while searching for solutions, how can I free up some space on the /boot partition?

Here is the output of a ls command on the mounted boot partition in a live cd session:

abi-3.13.0-67-generic
abi-3.13.0-68-generic
abi-3.13.0-70-generic
abi-3.13.0-71-generic
abi-3.13.0-73-generic
abi-3.13.0-74-generic
abi-3.13.0-76-generic
abi-3.13.0-77-generic
abi-3.13.0-79-generic
abi-3.13.0-83-generic
abi-3.13.0-88-generic
abi-3.13.0-91-generic
abi-3.13.0-92-generic
abi-4.4.0-31-generic
config-3.13.0-67-generic
config-3.13.0-68-generic
config-3.13.0-70-generic
config-3.13.0-71-generic
config-3.13.0-73-generic
config-3.13.0-74-generic
config-3.13.0-76-generic
config-3.13.0-77-generic
config-3.13.0-79-generic
config-3.13.0-83-generic
config-3.13.0-88-generic
config-3.13.0-91-generic
config-3.13.0-92-generic
config-4.4.0-31-generic
grub
initrd.img-3.13.0-67-generic
initrd.img-3.13.0-68-generic
initrd.img-3.13.0-70-generic
initrd.img-3.13.0-71-generic
initrd.img-3.13.0-73-generic
initrd.img-3.13.0-74-generic
initrd.img-3.13.0-76-generic
initrd.img-3.13.0-77-generic
initrd.img-3.13.0-79-generic
initrd.img-3.13.0-83-generic
initrd.img-3.13.0-88-generic
initrd.img-3.13.0-91-generic
initrd.img-3.13.0-92-generic
initrd.img-4.4.0-31-generic
lost+found
memtest86+.bin
memtest86+.elf
memtest86+_multiboot.bin
System.map-3.13.0-67-generic
System.map-3.13.0-68-generic
System.map-3.13.0-70-generic
System.map-3.13.0-71-generic
System.map-3.13.0-73-generic
System.map-3.13.0-74-generic
System.map-3.13.0-76-generic
System.map-3.13.0-77-generic
System.map-3.13.0-79-generic
System.map-3.13.0-83-generic
System.map-3.13.0-88-generic
System.map-3.13.0-91-generic
System.map-3.13.0-92-generic
System.map-4.4.0-31-generic
vmlinuz-3.13.0-67-generic
vmlinuz-3.13.0-68-generic
vmlinuz-3.13.0-70-generic
vmlinuz-3.13.0-71-generic
vmlinuz-3.13.0-73-generic
vmlinuz-3.13.0-74-generic
vmlinuz-3.13.0-76-generic
vmlinuz-3.13.0-77-generic
vmlinuz-3.13.0-79-generic
vmlinuz-3.13.0-83-generic
vmlinuz-3.13.0-88-generic
vmlinuz-3.13.0-91-generic
vmlinuz-3.13.0-92-generic
vmlinuz-4.4.0-31-generic
Ceda EI
  • 2,070

1 Answers1

0

Since your system is booting up (though not in GUI), you can remove old kernels using tty. To do so, follow these steps.

  • After booting the system (where you see the cursor and blank screen), switch to tty by pressing Ctrl + Alt + F1.

  • Enter your username and password.

  • Run this command to check out the current kernel. uname -r. Do not remove this kernel in the next steps. This is just a safety measure.

  • Next run this command dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r). This command lists all the kernels excluding the current kernel.

  • Remove all kernels starting with ii using the command sudo dpkg --purge kernel-name. For example sudo dpkg--purge linux-image-4.4.0-21. If the command failes, then remove the dependency packages that are mentioned in the output the same way i.e. sudo dpkg --purge PACKAGE.

  • Also try to remove the respective header using the command sudo dpkg --purge linux-image-header linux-image. The header must correspond to the kernel being removed. This means that if the kernel removed is linux-image-4.4.0-21 then the header would be linux-image-4.4.0-21-header. It is ok even if this command fails.

  • Finally, fix the broken dependencies usingsudo apt install -f

Ceda EI
  • 2,070