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 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 May 23 '13 at 5:38
show 3 more comments

2 Answers

up vote 8 down vote accepted

To make things easier, reply to my comment on your question first, and I'll update my answer to be straight forward.

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 some old kernels installed that are not needed; this is evident from 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. It 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 the old kernel versions is:

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

...where the x characters are numbers. So, in your case, we would have to run this command for each of the versions, like sudo apt-get purge linux-image-3.5.0-17-generic, sudo apt-get purge linux-image-3.5.0-18-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 those versions in the brackets. I've left out versions 3.5.0-25, 3.5.0-26, and 3.5.0-28 because from your dpkg output, your 3.5.0-28 is half configured (from the iF status next to it), so I'm assuming that was the one that your upgrade was trying to upgrade to. So, a guess would say that the current running kernel is 3.5.0-26, that's why I'm not including the number 26 in the brackets. But again, you need to find out what version you're running by uname -r. If the last number from that output is one of the numbers in the brackets above, DO NOT RUN THE COMMAND, and let us know.

But if the last number in uname -r is 26, or 28, or even 25, then it's safe to run the above command (however, if it's 25, remove number 24 from the brackets). Enter your password when prompted, and type y when asked. This will show a bunch of lines, and will eventually go back to 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 proceed with your update.

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
    
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 May 24 '13 at 14:22
    
Also, @carmatt95 I'm just curious, what was the output of your uname -r? –  Alaa 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
    
The described solution does not work, since apt-get purge still tries to install the broken new kernel prior to removing the old ones and stops as soon as it can't do that. –  ali Nov 1 '13 at 12:43
show 1 more comment

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
add comment

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.