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
  • The command that lists all the kernels has no output, is there a way to do this using a live cd, as i can copy and paste commands and post any results here – J Pockets Aug 07 '16 at 11:44
  • Try the command without the following part. | grep -Fv $(uname -r). If the command lists only one kernel that means that there is no old kernel. Also, in order to avoid errors, do copy the command instead of typing it. – Ceda EI Aug 07 '16 at 12:05
  • Thank you for answers, i have tried your suggestion and there is only one kernel. I can mount the boot partition using a live cd session and post the output of a file listing, to show what files are taking up space. My mistake was assuming there were old kernels. – J Pockets Aug 07 '16 at 20:27
  • I added a file list of the contents of /boot to my question, sorry it is hard to read – J Pockets Aug 07 '16 at 22:24
  • Please start a new question since the issue is different than the one posted in above question. Post a link to the question here so that I can help. Also if this answer helped you please upvote it and mark it as selected. – Ceda EI Aug 08 '16 at 06:35
  • Here is a link to a new question http://askubuntu.com/questions/809537/how-do-i-free-up-some-space-on-boot-partition-using-a-live-cd-session – J Pockets Aug 08 '16 at 09:08
  • I deleted all the files in boot except for the latest versions, did not have any luck when trying solutions, so I have solved the problem with a reinstall – J Pockets Aug 10 '16 at 09:34