1

I get the below error when I try to install updates using Software Updater:

Not enough free disk space
The upgrade needs a total of 81.3 M free space on disk '/boot'.
Please free at least an additional 15.9 M of disk space on '/boot'.
Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.

What should I do?

firmtechnologies@FirmTechnologies:~$ (ls -l /boot)
total 155801
-rw-r--r-- 1 root root  1158016 May  3 01:30 abi-3.13.0-24-generic
-rw-r--r-- 1 root root  1161713 May  8 01:31 abi-3.13.0-26-generic
-rw-r--r-- 1 root root  1161713 May 15 20:07 abi-3.13.0-27-generic
-rw-r--r-- 1 root root  1161764 Jun  4 22:57 abi-3.13.0-29-generic
-rw-r--r-- 1 root root   165510 May  3 01:30 config-3.13.0-24-generic
-rw-r--r-- 1 root root   165538 May  8 01:31 config-3.13.0-26-generic
-rw-r--r-- 1 root root   165521 May 15 20:07 config-3.13.0-27-generic
-rw-r--r-- 1 root root   165544 Jun  4 22:57 config-3.13.0-29-generic
drwxr-xr-x 5 root root     1024 Jun  6 14:31 grub
-rw-r--r-- 1 root root 29091568 May  7 21:31 initrd.img-3.13.0-24-generic
-rw-r--r-- 1 root root 29094684 May 12 12:24 initrd.img-3.13.0-26-generic
-rw-r--r-- 1 root root 29095678 May 18 10:57 initrd.img-3.13.0-27-generic
-rw-r--r-- 1 root root 29093700 Jun  6 14:32 initrd.img-3.13.0-29-generic
drwx------ 2 root root    12288 Apr 30 17:11 lost+found
-rw-r--r-- 1 root root   176500 Mar 12 13:31 memtest86+.bin
-rw-r--r-- 1 root root   178176 Mar 12 13:31 memtest86+.elf
-rw-r--r-- 1 root root   178680 Mar 12 13:31 memtest86+_multiboot.bin
-rw------- 1 root root  3372643 May  3 01:30 System.map-3.13.0-24-generic
-rw------- 1 root root  3377429 May  8 01:31 System.map-3.13.0-26-generic
-rw------- 1 root root  3377429 May 15 20:07 System.map-3.13.0-27-generic
-rw------- 1 root root  3378267 Jun  4 22:57 System.map-3.13.0-29-generic
-rw------- 1 root root  5776416 May  3 01:30 vmlinuz-3.13.0-24-generic
-rw------- 1 root root  5790912 May  8 01:30 vmlinuz-3.13.0-26-generic
-rw------- 1 root root  5790912 May 15 20:07 vmlinuz-3.13.0-27-generic
-rw------- 1 root root  5792544 Jun  4 22:57 vmlinuz-3.13.0-29-generic
karel
  • 114,770
FirmTech
  • 129
  • The answer to your question is greatly depending of your filesystem layout. Could you add the output of df -h, and also the list of the /boot content (ls -l /boot). – Benoit Jun 10 '14 at 12:41
  • output of df -h firmtechnologies@FirmTechnologies:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu--vg-root 288G 97G 177G 36% / none 4.0K 0 4.0K 0% /sys/fs/cgroup udev 2.4G 4.0K 2.4G 1% /dev tmpfs 491M 1.2M 490M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.4G 80K 2.4G 1% /run/shm none 100M 60K 100M 1% /run/user /dev/sda1 236M 161M 63M 73% /boot firmtechnologies@FirmTechnologies:~$ OUTPUT OF /boot gives firmtechnologies@FirmTechnologies:~$ /boot – FirmTech Jun 11 '14 at 08:57

3 Answers3

2

Remove old kernels

Run this command in a Terminal:

sudo apt-get remove $(dpkg --get-selections | awk '{ if($2 == "install") { print($1); } }' | grep -P '^linux-(headers|image)-(?!generic)' | grep -v "`uname -r | grep -oP '[^-]+-\d+'`")

Example output

This will attempt to remove all kernels from your system except the one you are using right now.

After reviewing the list confirm by pressing enter.
DO NOT CONTINUE IF IT SAYS SOMETHING ABOUT UNSATISFIED DEPENDENCIES!

As you can see in the screenshot this would free up about 1GB of space... all of which resides in the /boot partition!

ntninja
  • 726
  • i ran this code in terminal sudo apt-get remove sudo apt-get remove $(dpkg --get-selections | awk '{ if($2 == "install") { print($1); } }' | grep -P '^linux-(headers|image)-(?!generic)' | grep -v "uname -r | grep -oP '[^-]+-\d+'") and i got this [sudo] password for firmtechnologies: Reading package lists... Done Building dependency tree
    Reading state information... Done E: Unable to locate package apt-get E: Unable to locate package remove firmtechnologies@FirmTechnologies:~$
    – FirmTech Jun 11 '14 at 08:49
  • After running this it worked, but at last it was written "you may need to re-run your boot loader[grub]" Does that matter? – Freddy Sep 26 '14 at 05:29
0

Free some space for the updates like delete the temporary files form system and remove unwanted package’s installed on system if you are using dual boot then please ensure that you have given enough space for Ubuntu installation

try using sudo apt-get install bleachbit

Chinmaya B
  • 6,122
  • 7
  • 24
  • 43
0

I finally got it to work following Alexander255 's code but sudo apt-get remove was duplicated so i removed one of them and use the code as stated below:

sudo apt-get remove $(dpkg --get-selections | awk '{ if($2 == "install") { print($1); } }' | grep -P '^linux-(headers|image)-(?!generic)' | grep -v "uname -r | grep -oP '[^-]+-\d+'")

and it worked perfectly. Thanks so much.

FirmTech
  • 129