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 been playing with package management by adding sources from older Ubuntu releases in order to get older versions of some software (e.g. PHP). Unfortunately at some point I must have overdid it as now every attempt to use apt-get or synaptic ends in an error message being displayed saying that there is no candidate available to install.

I would like to start fresh - remove all the installed packages and added sources. Is there a quick way to do this, or do I need to reinstall the OS?

share|improve this question
3  
This is called re-install, isn't it? :D –  txwikinger Jul 28 '10 at 20:14

3 Answers 3

up vote 2 down vote accepted

You could always remove all packages (making a few exceptions for apt-get, etc.)

Then run:

sudo apt-get install ubuntu-desktop

This installs the desktop metapackage which has pretty much every other package as a dependency.

share|improve this answer

You can do an installation of Ubuntu over top of an existing installation. You'll lose all of your (non-local [1]) system files and applications, but it will preserve everything in /home.

Select the advanced partitioning option from the menu of either the desktop CD installer or the alternate CD installer. Set the mountpoint of your existing root partition to / and make sure the format box is not checked. Repeat these steps for your home partition, if you have one.

1: Where local system directories would be /usr/src, /usr/local, and /var/local.

share|improve this answer

Remove all but the current release of Ubuntu you're running from /etc/apt/sources.list. Then sudo apt-get update; sudo apt-get dist-upgrade. Let me know if you still have trouble.

You may have to reinstall.

share|improve this answer

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.