Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm new to Ubuntu and I'm getting an error in software updater. When I try and do my daily updates, it says:

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

I tried typing in sudo apt-get clean into the terminal but I still get the message. All of the pages I read seem to be for experianced Ubuntuers. Any help would be appreciated. I'm running Ubuntu 12.10. I want to upgrade to 13.04 but understand I have to finish these first.

EDIT: @Alaa, This is the output from typing in cat /etc/fstab into the terminal:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/ubuntu-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=fa55c082-112d-4b10-bcf3-e7ffec6cebbc /boot           ext2    defaults        0       2
/dev/mapper/ubuntu-swap_1 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
matty@matty-G41M-ES2L:~$ 

df -h:

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu-root  915G   27G  842G   4% /
udev                     984M  4.0K  984M   1% /dev
tmpfs                    397M  1.1M  396M   1% /run
none                     5.0M     0  5.0M   0% /run/lock
none                     992M  1.8M  990M   1% /run/shm
none                     100M   52K  100M   1% /run/user
/dev/sda1                228M  222M     0 100% /boot
matty@matty-G41M-ES2L:~$ 

dpkg -l | grep linux-image:

ii linux-image-3.5.0-17-generic 3.5.0-17.28 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-18-generic 3.5.0-18.29 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-19-generic 3.5.0-19.30 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-21-generic 3.5.0-21.32 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-22-generic 3.5.0-22.34 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-23-generic 3.5.0-23.35 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-24-generic 3.5.0-24.37 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-25-generic 3.5.0-25.39 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
ii linux-image-3.5.0-26-generic 3.5.0-26.42 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
iF linux-image-3.5.0-28-generic 3.5.0-28.48 i386 Linux kernel image for version 3.5.0 on 32 bit x86 SMP
share|improve this question
    
Can you edit your question to include the output of df -h and ls -l /boot. –  Alaa Ali May 22 '13 at 4:53
1  
Also, the contents of your /etc/fstab might be helpful. What it seems like is that /boot is mounted on a separate partition. –  Githlar May 22 '13 at 5:37
    
Like says @Githlar your fstab can give us information about your hd partitions. –  ssoto May 22 '13 at 7:11
    
So what do I do to access the fstab? I'm fairly Linux illiterate. Any analogies to Windows? @alaa Thanks for the help. –  carmatt95 May 22 '13 at 22:29
    
fstab is a file that contains information on the partitions that are mounted when you boot up your computer. To show the contents of this file, type cat /etc/fstab in a terminal. Copy the output and add it to your question (you can edit your question). Also, copy the output of df -h and dpkg -l | grep linux-image. –  Alaa Ali May 23 '13 at 5:38

5 Answers 5

up vote 24 down vote accepted

Okay, so from the output of /etc/fstab you posted, it seems that your /boot is mounted on a separate partition, and from the output of df -h, that partition is full. This is because there are old kernels installed that are not needed; you can tell that by looking at the output of dpkg -l | grep linux-image that you posted, where you can see more than one "linux-image" with different versions. We need to remove the old versions.

First, I want you to run the command uname -r in a terminal, this will show you the kernel version you are currently using. We never want to remove that kernel version. The command will say something like this 3.5.0-26-generic. Take a note of that number, 26! The following commands will assume that that's the kernel you're running.

The command to remove an old kernel version is:

sudo apt-get purge linux-image-x.x.x-xx-generic

...where the x characters are numbers. So, in your case, because you have a lot of old versions (17, 18, 19, etc...), we would have to run this command for each of the versions, like this:

  • sudo apt-get purge linux-image-3.5.0-17-generic
  • sudo apt-get purge linux-image-3.5.0-18-generic
  • sudo apt-get purge linux-image-3.5.0-19-generic

...and so on. But, there's a way to do all of this through one command. The command is this:

sudo apt-get purge linux-image-3.5.0-{17,18,19,21,22,23,24}-generic

DO NOT RUN THE COMMAND YET! Read the following.

This command will remove the versions mentioned in the brackets. I didn't include versions 25, 26 and 28 because of the following reasons:

  • Didn't include 26 obviously because that is the kernel version you are currently running! That's the version we got from the command uname -r, remember? We never want to remove that!
  • Didn't include 28 because that's the one that your upgrade was trying to upgrade to (you can tell that from the iF status next it, meaning that it's "half configured").
  • Didn't include 25 because it is usually good practice to leave at least one old version. So since you're running 26, we'll keep 25, so we won't include it in the command above.

So if the last number in uname -r is 26 (or 28, or even 25), then it's safe to run the above command. Enter your password when prompted, and type y when asked. This will show a bunch of lines, and will eventually go back to the command prompt (in your case, matty@matty-G41M-ES2L:~$), hopefully without errors. When it's done, do df -h and look at the last line, the one that starts with /dev/sda1. You should find that it now has more space, and that the percentage used is less than 100% like it was before. You can now proceed with your update again.

share|improve this answer
    
It worked!!! Thanks so much! Bonus question: when I first dowloaded Ubuntu, I accidentaly deleted the "pictures" folder in home area. Becasue of this, there's no "pictures" tab on the side. I've gotten around this by just creating a folder called "pictures" but it doesn't show up in the side bar. Do you know how to get it there? I tried clicking and dragging, but to no avail. @Alaa –  carmatt95 May 24 '13 at 3:30
1  
You're welcome! For the other question, create another question and I'll answer it. This way, people that are searching for that problem can find it. –  Alaa Ali May 24 '13 at 14:22
    
Also, @carmatt95 I'm just curious, what was the output of your uname -r? –  Alaa Ali May 24 '13 at 17:15
    
my output, as you guessed, was "3.5.0-26-generic" Here's the link to me new post: askubuntu.com/questions/301244/picture-tab-is-missing –  carmatt95 May 28 '13 at 20:56
1  
yep, back here again to reference the same thing. You'd think I would remember it by now. –  sevenseacat Jul 18 at 1:33

You can install Ubuntu-Tweak.To install follow the following steps:

Open the terminal. Add the required repository with the command:

sudo add-apt-repository ppa:tualatrix/ppa

Update the software list with the command:

sudo apt-get update

Finally, install Ubuntu Teak with the command:

sudo apt-get install ubuntu-tweak

After that, open dash and type "ubuntu tweak".

And then go to janitor tab and select Apps , Personal and System check boxes and click clean button at bottom right.

share|improve this answer

Do you have any old kernel image packages installed, which aren't being used? Those can take up space on /boot. I'd recommend reviewing the set of installed kernel packages with a command such as the following:

dpkg -l "linux-image*" | grep "^i"

That should provide an overview of the set of kernel image packages installed. For those linux-image packages that are not being used and that would not be expected to be needed for recovery purposes -- for example, e.g. I like to keep at least one kernel version behind the active version installed, for recovery -- otherwise, you could remove any such unused packages, using your favorite packaging tool, such as aptitude.

I'd also recommend taking a look at the related inux-headers, linux-image-extras (if applicable), also linux-source, and linux-tools packages, such that may be installed together with any unused linux-image packages.

share|improve this answer

On my home Ubuntu system I follow a similar method to that posted, but it's a little simpler and clears more space inc kernel headers, etc.

  1. I check what running kernel I'm using as it is imperative not to interfere with that.

    uname -a
    
  2. Then, I look at /boot with the aim of removing all kernel related files that are not related directly to the running kernel. This gives me a list of all the kernel versions I want to remove, for example: 3.5.0-17, 3.5.0-18

    ls -l /boot
    
  3. Now I take the first kernel version in my purge list and find all the packages related to it.

    dpkg -l | grep 3.5.0-17
    
  4. Purge them from the system

    sudo apt-get purge <list of packages separated by spaces>
    
  5. go back to 3 and select the next kernel version in my purge list.

  6. Done

share|improve this answer

I was getting this error, this article helped.

I used df -h to identify that boot was full, uname -r for version, then used the purge string listed above to remove old kernels. single kernel purge worked, multi did not (for me).

I found the files in the windows thing; I could not delete them, had to use the terminal, but it did show me the old versions I had in there.

I have no idea why /boot (sda2) is partitioned at all and why its so small. but now I can use Ubuntu updater again.

I did have some minor success with sudo apt-get update,sudo apt-get upgrade, sudo apt-get clean, also tried free software Bleachbit. Use the purge string but not on your current version. Hope this helps someone.

share|improve this answer
    
edit: i don't think you have to add"-generic" to the purge string –  Brian P Aug 13 at 2:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.