Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Ubuntu 9.10 on a computer with 4 GB available space (I can't delete stuff from the Windows partition yet). After two automatic Update Manager updates, my disk space is almost all gone. In grub I can see the following list of OS choices:

Ubuntu, Linux 2.6.31-20-generic
Ubuntu, Linux 2.6.31-20-generic (recovery mode)
Ubuntu, Linux 2.6.31-19-generic
Ubuntu, Linux 2.6.31-19-generic (recovery mode)
Ubuntu, Linux 2.6.31-14-generic
Ubuntu, Linux 2.6.31-14-generic (recovery mode)
Windows

I'm confident -20 is running well, so is it possible to remove the -14 and -19 versions? Note that I'm asking is it possible to remove those kernel versions from the disk, not just from grub. Will this free up much disk space?

share|improve this question
up vote 3 down vote accepted

run uname -a to verify you are running the right kernel

sudo apt-get remove '.*2.6.31-14.*'
sudo apt-get remove '.*2.6.31-19.*'

should do the trick... it will remove the kernel and any other related packages for that version. Give it a look over to make sure that only kernel related stuff matches before you enter 'y'.. I don't know of any packages that would have a version of 2.6.31-14 that are not kernel related, but it doesn't hurt to check.

I'd leave the previous kernel for a while until you are sure that the latest one is stable.

also,

running apt-get clean will remove all of the old .debs you have on your system.

you can install debian-goodies and run dpigs to see what packages are the biggest.

justin@eee:~$ dpigs
111836 openoffice.org-core
88128 linux-image-2.6.31-19-generic
71556 linux-headers-2.6.31-19
48516 google-chrome-unstable
44848 openoffice.org-common
44044 wireshark-common
37776 libgl1-mesa-dri
33976 gimp-data
33012 smbclient
24672 vim-runtime

There is also the "Disk Usage Analyzer" program in Accessories that you can use to see what is taking up space, or run

du -acx / | sort -n

You can also try system -> administration -> computer janitor, but I never use it and have heard mixed things about it.

share|improve this answer
    
@justin - Wonderful, thanks. The apt-get remove lines were exactly what I was looking for. – mtrw Mar 6 '10 at 0:53

Use yum list to get the exact package names, then yum erase to remove them.

share|improve this answer
    
the question was about ubuntu. – user23307 Mar 6 '10 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .