Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to remove a repository in 12.04, like so

sudo add-apt-repository --remove ppa:cassou/emacs
sudo apt-get update

but when I run the command

ls /etc/apt/sources.list.d

I get the name of ppa mentioned in the list


Why so?

share|improve this question
What are the contents of /etc/apt/sources.list.d/cassou-emacs-precise.list? The lines are probably commented out. You can also just delete the files manually by the way. – terdon Mar 17 '14 at 16:15
@terdon Ok, the file looks empty. But it was not deleted automatically. – Gaurav Agarwal Mar 17 '14 at 16:27

add-apt-repository --remove doesn't actually remove the repository but disables it. If you want to remove the repository along with any package it may have installed you can by using ppa-purge:

sudo ppa-purge ppa:cassou/emacs

NOTE: This will downgrade any packages you might have installed from the PPA to the version available in the main repositories. As explained in man ppa-purge:

   ppa-purge - disables a PPA and reverts to official packages
share|improve this answer
ppa-purge does more than that it is - command line tool that downgrades all the packages installed from a PPA to the versions available in the official Ubuntu repositories. – Gaurav Agarwal Mar 17 '14 at 17:02
@GauravAgarwal surely that will only happen if the tools in question are available in both? – terdon Mar 17 '14 at 17:36
@terdon Yes, for the reason you mentioned, this cannot be considered the answer to the problem. – Gaurav Agarwal Mar 17 '14 at 18:04

The repositories have been removed, if you check the contents of those files, you will find them empty. I don't know why they were not removed and I would call that a bug in add-apt-repository unless empty files are removed by default on reboot or similar.

In any case, for future reference, you can always simply delete the files manually:

sudo rm /etc/apt/sources.list.d/cassou-emacs-precise.list*
sudo apt-get update
share|improve this answer
It does not remove even after restart. Do we need to file a bug report on add-apt-repository? – Gaurav Agarwal Mar 17 '14 at 17:13

Your Answer


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.