A new script introduced in Ubuntu 9.10 Karmic Koala to add apt repositories and import the gpg key is “add-apt-repository“.
Sample usage:
~$ sudo add-apt-repository ppa:gmpc-trunk/mpd-trunk
For some reason there is no script to remove repositories that have been set up this way.
Luckily the guys from sourceslist.eu (it) wrote a script fixing this issue.
It can be downloaded either as a bash script or as deb package.
After the installation the usage is straighjt forward using the same syntax:
~$ sudo remove-apt-repository gmpc-trunk/mpd-trunk

Hello! I am the author of the script and the webmaster of the site http://www.sourceslist.eu. You should make a small correction to your article.
The correct syntax to remove the repository is “sudo remove-apt-repository gmpc-trunk/mpd-trunk” and not “sudo remove-apt-repository ppa:gmpc-trunk/mpd-trunk.
However on my site are totally alone, every collaboration is always welcome. Bye Ingalex
fixed. thanks!
remove-apt-repository ubuntu-mozilla-daily/ppa
unsuccessful removing – ppa launchpad repository not present or wrong syntax
I have no idea if this simply wasn’t implemented in previous versions of Ubuntu (the article is written for 9.10), but as of 10.10, the supported syntax is shown below.
to add a repository (copied from article, still correct):
sudo add-apt-repository ppa:gmpc-trunk/mpd-trunk
sudo apt-get update
to remove the repository, simply add the “–remove” (or “-r”) option:
sudo add-apt-repository –remove ppa:gmpc-trunk/mpd-trunk
Could the writer of this article update the article with contents of the last reply from Oval?
In Ubuntu 11.04 natty the “#sudo remove-apt-repository gmpc-trunk/mpd-trunk” doesn’t work anymore. It has been changed into:
#sudo add-apt-repository –remove ppa:gmpc-trunk/mpd-trunk” (“–remove” can be replaced by “-r”)
Spread the word… It might help the community!