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 have a Dell Mini 9 with a 8 GB SSD. I installed Lucid some years ago, and upgraded each time, and now my hard disk is almost full. I see that new default programs get installed but old ones do not get automatically removed (e.g. Banshee and Rhythmbox). Now I can install a new distro from scratch but if there is a way to avoid the hassle, it would be great. I don't mind if the programs I have installed over the years get removed, they are only a few and I can reinstall them in a snap.

share|improve this question
    
I think this can help: askubuntu.com/questions/33907/cleaning-disc-space –  desgua May 3 '11 at 12:55
2  
My best bet would be somehow purging all installed packages and then install ubuntu-desktop metapackage. The reason this is a comment is because I don't know how to specify all packages, but if you are able to delete them, and install ubuntu-desktop you will land with the default install of your current Ubuntu version. –  Oxwivi May 3 '11 at 13:12

2 Answers 2

up vote 9 down vote accepted

The solution to this question will probably solve your problem too.

Ubuntu pre-12.04

From a gnome-terminal do:

cat filesystem.manifest-desktop | awk '{print $1}' | sort > default.txt

This will get rid of the package versions and leave you with a sorted list default.txt containing all packages that are installed by default. As mentioned in the linked question, keep in mind that you might changed the default installation when installing updates and/or restricted packages during the installation of Ubuntu.

Ubuntu 12.04

The above step has changed a bit. To get a list of the packages that are initially installed, you need to unpack two files:

  1. filesystem.manifest
  2. filesystem.manifest-remove

To get what you want, you need to remove the latter from the former:

comm -3 <(cat filesystem.manifest | awk '{print $1}' | sort) <(cat filesystem.manifest-remove | sort) > default.txt

Now continue like pre-12.04:

dpkg --get-selections | awk '{print $1}' | sort > current.txt

This will get you a sorted list current.txt of all currently installed packages.

diff -u default.txt current.txt | grep "^+[^+]" | cut -c 2- > installed.txt
diff -u default.txt current.txt | grep "^-[^-]" | cut -c 2- > uninstalled.txt

This will get you the differences between the two package lists, where installed.txt contains all packages not part of the default installation, and uninstalled.txt contains all packages you are missing compared to a default installation.

share|improve this answer
    
Thanks but I think I have created a dependency soup, I will go with the installation from scratch. Your method seems to work though. –  qwazix May 6 '11 at 10:10
1  
Thank you for your answer, this helped me a bunch! FYI for future users: filesystem.manifest-desktop can be found on the Ubuntu CD under the casper/ folder. Other than that this worked perfectly, thanks again! –  Tovi7 Jan 27 '12 at 9:12

If you insist on removing those packages manually you can fire up Ubuntu Software Center or even good old but slighly more risky Synaptic, browse the 'installed' section and start removing whatever you think you do not need. That can include all the old programs but even programs that are in your current install but you never will use.

I bet it will be an odd 10 or so you want to remove and that might take you a 15 minutes,

share|improve this answer
2  
That won't help in finding and selecting the default package line up. –  Oxwivi May 3 '11 at 13:09

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.