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 experienced Ubuntuers. I'm running Ubuntu 12.10. I want to upgrade to 13.04 but understand I have to finish these first.

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:~$

So what do I do to access the fstab? I'm fairly Linux illiterate. Any analogies to Windows? @alaa Thanks for the help.
–
carmatt95May 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 AliMay 23 '13 at 5:38

6 Answers
6

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.

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
–
carmatt95May 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 AliMay 24 '13 at 14:22

Also, @carmatt95 I'm just curious, what was the output of your uname -r?
–
Alaa AliMay 24 '13 at 17:15

Much better than messing with command line and trying to delete all kernels but not current when they have even different versions (not only -32 at the end) and also -extra packets. Ubuntu tweak saved me 5 minutes, thanks!
–
POMATuSep 27 '14 at 21:29

@edwardtorvalds Of course you can install it without adding its PPA on 14.04 and also 14.10 by its .deb package, but it's not the most preferable. The reason that you want to install that via its PPA is because it ensures updates.
–
KasiyADec 17 '14 at 18:16

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.

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

uname -a

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

Now I take the first kernel version in my purge list and find all the packages related to it.

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.

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.