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 added many PPAs using the add-apt-repository command. Is there a simple way to remove these PPAs? I've checked in /etc/apt/sources.list for the appropriate deb lines but they aren't there.

This is on a server system so a command line solution would be great!

share|improve this question
4  
There is a bug on Launchpad (bugs.launchpad.net/software-properties/+bug/446216) requesting a --remove argument for the add-apt-repository command. I've submitted a merge request (code.launchpad.net/~mac9416/software-properties/…) to get the feature implemented, but it hasn't yet been accepted. Hopefully you'll have this feature soon though. –  mac9416 Jul 29 '10 at 12:42
    
That's great news. It annoyed me a bit that there was no command do undo the adding; a bit like aptitude that only installs! ppa-purge is good but that's not even in the official repos. –  David Ashford Jul 30 '10 at 16:55
    
Related. (In particular, see this answer of mine for getting ppa-purge to work with multarch.) –  Eliah Kagan Sep 1 '12 at 14:35
add comment

16 Answers

up vote 196 down vote accepted

Use the --remove flag, similar to how the PPA was added:

sudo add-apt-repository --remove ppa:whatever/ppa

You can also remove PPAs by deleting the .list files from /etc/apt/sources.list.d directory.

share|improve this answer
8  
This will remove the PPA from the repository list but if the package is a newer version of one in the standard repos, you have to manually downgrade the package afterwards. ppa-purge (see other answer) does that for you. –  Marcel Stimberg Aug 11 '10 at 14:00
3  
I get add-apt-repository: error: no such option: --remove :-/ –  Rafa Feb 18 '13 at 14:12
    
it should be sudo apt-add-repository --remove ppa:repo_name/subdirectory –  MountainX Jun 20 '13 at 23:55
    
-r would do instead of --remove –  thameera Mar 4 at 18:13
add comment

You can use the

sudo ppa-purge ppa:repository-name/subdirectory

command in a terminal.

You will first need to install ppa-purge to use this command. To do so, use sudo apt-get install ppa-purge or click this button:

Install via the software center

Find out more about it here.

share|improve this answer
1  
This won't work for deleted repositories in which case it fails with "Warning: Could not find package list for PPA: repository-name subdirectory". –  Lekensteyn Oct 27 '11 at 9:26
    
It's not available for Ubuntu 11.10, or am I wrong? –  math Feb 6 '12 at 17:14
6  
Yo, this didn't work for me, but I love the syntax so much I am voting it up anyway. –  Conrad.Dean Mar 3 '12 at 2:45
    
@DaveJarvis it's not installed by default on any system =/. I've edited the answer to include information on how to install it. –  Alaa Sep 7 '13 at 8:33
add comment

The answers to this question will help you.

You can manage PPAs in System > Administration > Software Sources or by removing files in /etc/apt/sources.list.d/.

You can also use a package called ppa-purge.

And, as I commented on the question I linked to above,

There is a bug on Launchpad requesting a --remove argument for the add-apt-repository command. I've submitted a merge request to get the feature implemented, but it hasn't yet been accepted. Hopefully you'll have this feature soon though.

share|improve this answer
1  
I found it in Ubuntu Software Center > Edit > Software Sources. –  Josh M. Oct 1 '12 at 15:07
    
The "ppa-purge" link doesn't work. It gives a 404 error. –  Cristiana Nicolae Feb 10 at 8:05
add comment

Some people might prefer to add and remove repositories via a GUI. As of Ubuntu 10.10, this requires a bit of extra work. An explanation is available on the wiki. In order to try and have all answers for this question available in one place, I will try and summarize the important details here. Be sure to check the wiki (especially once a new version of Ubuntu is released) to ensure that this process is still valid.

First, you will want to re-enable 'Software Sources' in the System->Administration menu. Right click on the Applications/Places/System menu and click 'Edit Menus'.

Click 'Edit Menus'

This will open a window, scroll down and click on 'Administration'. Check the box next to 'Software Sources' and then click the 'Close' button.

Check the box next to 'Software Sources'

Go to System->Administration and you should see 'Software Sources' in the menu.

'Software Sources' now in menu

In the window that opens, click on the 'Other Software' tab at the top.

'Other Software' tab

You should see all of the repositories that you have added (including the PPAs added via add-apt-repository). You can temporarily disable a repository by unchecking the box next to it. To remove a repository permanently, highlight it and click on the 'Remove' button. When you are done, hit the 'Close' button.

As Marcel Stimberg noted earlier:

This will remove the PPA from the repository list but if the package is a newer version of one in the standard repos, you have to manually downgrade the package afterwards. ppa-purge (see other answer) does that for you.

Hopefully, this will help.

share|improve this answer
    
You don't need to edit the menu, there's an entry for Software Sources in the Software Center menu. –  Jorge Castro Dec 29 '10 at 2:25
    
Thanks. It looks like an issue with gksu on my end caused me to not get presented with the Software Sources when I tried that initially. I'll resolve that issue locally and update the answer. –  nhandler Dec 29 '10 at 19:16
add comment

Since Ubuntu Maverick (10.10) add-apt-repository accepts a -r or --remove parameter which removes the PPA in the same way you installed it. :)

So:

Install: sudo apt-add-repository ppa:user/repository

Uninstall: sudo apt-add-repository -r ppa:user/repository

share|improve this answer
2  
Thanks! I used sudo apt-add-repository -r ppa:user/repository to uninstall a stubborn ppa from New Linux Counter Project. I have tried a lot of command lines and suggestions but none of them was of any help, only yours worked! Thanks! One info: it works in 12.04 LTS too, not only in Maverick. –  Cristiana Nicolae Feb 10 at 8:20
    
You're welcome, @CristianaNicolae! I've updated my answer based on your advice, thank you! :) –  Paulo Freitas Feb 14 at 11:33
add comment

Depending if add-apt-repository was invoked with a full sources.list line or a ppa it appends the line to /etc/apt/sources.list or a new file in the /etc/apt/sources.list.d/ directory. If it's a ppa it will then import the ppa GPG key into apt's keyring

To reverse the actions done by add-apt-repository you can either manually remove the apt line or use a tool like "Software Sources" to do it and then remove the GPG key using apt-key like so:

"sudo apt-key list" to find out the id for the repository you want to remove and then
"sudo apt-key del id" where is looks like 7FAC5991. The id is the part after the "/" character.

share|improve this answer
add comment

There's a command, add-apt-repository -r.

But deleting the file and re-running sudo apt-get update is also fine.

share|improve this answer
    
I don§t know how is this meant to behave, but after the command return and apt-get update, corresponding files were still in /etc/apt/list.sources.d. I've removed them manually and re-run update, I don't know if it was necessary. –  Ivan Dec 20 '10 at 3:18
add comment

Apart from the solution mentioned already: If you still have software installed from that repository, it is best to revert them to the original version supplied with ubuntu: the one from the ppa will not get (security and other) updates anymore. There is a tool that will do just that: ppa-purge http://packages.ubuntu.com/maverick/ppa-purge

share|improve this answer
    
ppa-purge is good stuff, but it's also powerful stuff. –  Ryan Thompson Dec 20 '10 at 23:52
    
The link opens an error page. –  Cristiana Nicolae Feb 10 at 8:22
add comment

You can manage your repositories in System > Administration > Software Sources

You can also remove them in /etc/apt/sources.list.d/ where you'll find a <repo>-ppa-<distro>.list file You can remove that file or simply comment out the deb line

share|improve this answer
add comment

If you are talking about the actual applications installed via a PPA, they will be listed just as any other application and you would uninstall it the same way. The PPAs (repositories) themselves will be listed under the 'Other Software' tab of the Settings->Repositories menu. They can be removed just like any other source.

Screenshot of Synaptic Repository/PPA screen

share|improve this answer
add comment

It depends. If you've installed a new application from a ppa, then you can uninstall it normally. However, if you've enabled a ppa to get a newer version of a program that you've alredy installed (Firefox 4,newer Xorg drivers,etc), then you need to use a program called ppa-purge.

Ppa-purge is available in the repositories for Maverick and newer. A backport is available for Lucid users. Just install it and then run

sudo ppa-purge ppa:repository-name/directory

The above command will disable the ppa from your software sources and then reinstall the official version of the upgraded application from the Ubuntu repository.

share|improve this answer
add comment

OMG!Ubuntu! mentioned that this feature had been added to the 'Tweak' PPA.

Presumably once it's in universe, you'll be able to use it to remove itself :)

share|improve this answer
add comment

You can try those command below and it works very well for me to remove Linux kernel 3.5 (ppa:xorg-edgers/ppa).

sudo apt-get install ppa-purge
sudo ppa-purge ppa:<XXX>/<YYY>
share|improve this answer
add comment

add-apt-repository now accepts a --remove argument.

https://bugs.edge.launchpad.net/ubuntu/+bug/446216

I proposed adding a rm-apt-repository command as well:

https://code.edge.launchpad.net/~bryceharrington/software-properties/rm-apt-repository/+merge/25988
share|improve this answer
add comment

http://www.getdeb.net/software/ppa-purge May be this will help if you dont want to comment the sources.list

share|improve this answer
add comment

You can use Ubuntu-Tweak, which makes it very easy to edit ppa. You can delete the ppa's manually or when Ubuntu-Tweak know it just click a button.

share|improve this answer
add 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.