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!
There are a number of options:
Use the
--remove
flag, similar to how the PPA was added:You can also remove PPAs by deleting the
.list
files from/etc/apt/sources.list.d
directory.As a safer alternative, you can install ppa-purge:
And then remove the PPA, downgrading gracefully packages it provided to packages provided by official repositories:
Note that this will uninstall packages provided by the PPA, but not those provided by the official repositories. If you want to remove them, you should tell it to apt:
Last but not least, you can also disable or remove PPAs from the "Software Sources" section in Ubuntu Settings with a few clicks of your mouse (no terminal needed).
Simply run
apt-add-repository
again with the--remove
option to remove a PPA added via the command-line. For example:Then update with:
Alternately, as
ppas
are stored in/etc/apt/sources.list.d
you can find the one you want to remove by entering:Then when you have noted the name of that offending ppa (e.g.
myppa.list
), you can enter:Take care with rm (hence why I have used the interactive switch so you can confirm your actions. Then run
sudo apt-get update
afterwards.This method merely removes the ppa
.list
file; it does not remove any other files or sort out any other problems caused by theppa
; for that you could useppa-purge
after you have got your update ability back (I know you mentioned this in your question, but I am adding this point for future readers): see here for more information onppa-purge
.Also take into account that if you previously added the key of the repo as trusted you should remove it:
You can use the
command in a terminal.
You will first need to install
ppa-purge
to use this command. To do so, usesudo apt-get install ppa-purge
or click this button:(source: hostmar.co)
Find out more about it here.
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,
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'.
This will open a window, scroll down and click on 'Administration'. Check the box next to 'Software Sources' and then click the 'Close' button.
Go to System->Administration and you should see 'Software Sources' in the menu.
In the window that opens, click on the 'Other Software' tab at the top.
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:
Hopefully, this will help.
ppa-purge
is your friend. It automatically uninstalls whatever you installed via the ppa and then removes the ppa.Install ppa-purge via:
sudo apt-get install ppa-purge
and the use it like this:
sudo ppa-purge ppa-url
Viola.
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
Run Ubuntu Software Center and from the menu choose "Software Sources" - there you can add/edit/remove repositories.
Run these commands: