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've installed a number of packages from PPAs, and I would like to revert to official versions now. Many of the PPAs no longer exist in /etc/apt/sources.list.d, so ppa-purge will not work on them.

What is the most straight-forward way for that?

share|improve this question
add comment

1 Answer

Well you can remove and reinstall the packages

ppa-purge is probably still your best bet for a clean escape. Just re-adding the PPA the package came from and then using ppa-purge to kill it. I'm not sure how many PPAs you have installed but if it's fewer than 10, I'd be looking at doing this.

If you think that method is too soft I've just written some bash-porn to help identify package versions whose installation source now only exists locally in /var/lib/dpkg/status. This is not the same as "orphaned" packages.

for p in `dpkg-query --showformat='${Package} ' -W`; do
    if [[ $(apt-cache policy $p | grep -Pzo "\*\*\* [^\n]+\s+100") ]]; then
        echo $p;
    fi;
done

I'm not sure if this is perfect yet but give it a go. Note it's only going to print out the names of the packages. You're going to have to manually uninstall/reinstall each package.

To do that, first look at what is available for that package by running apt-cache policy <package> and you'll see a list of package versions (including the /var/lib/dpkg/status version). Find the nearest external one and run:

sudo apt-get install <package>=<version>

You might need to add a --reinstall after the install but see how it goes.

share|improve this answer
1  
@Jokerdino That is subtly (but importantly) different. That only finds orphaned packages, that is, packages which have no current viable installation repository so it will only show things you've installed from a PPA that don't exist elsewhere. For things where you upgrade the current packages (eg if you used xorg-edgers to upgrade the whole X system) those packages aren't counted. –  Oli Jul 20 '12 at 11:52
    
Sorry. I just noticed that and removed my comment (but it was too late.. :/). For reference to others who might want to follow the conversation, I linked to this answer. –  jokerdino Jul 20 '12 at 11:53
    
As per the official statement, ppa-purge was removed from ubuntu because, all of its functionality can be done by apt-get. How can I do this with apt-get. –  rafee Dec 27 '13 at 10:42
    
@rafee Why do you think ppa-purge was removed? It's in the repos for Trusty as well as every other supported release. –  Oli Dec 27 '13 at 10:44
    
Its removed from default installation & it requires aptitude as dependency. –  rafee Dec 27 '13 at 14:30
show 1 more 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.