I would like to run the reverse of this command to remove the non-compatible repository in Debian 8.1

sudo add-apt-repository -y ppa:nemh/systemback

where the command add-apt-repository is in the package software-properties-common. I could not find the systemback entry in /etc/apt/sources.list.

How can you run the reverse of the command?

  • 2
    Basically - the fastest way is: sudo add-apt-repository -r ppa:nemh/systemback – jvc26 Jul 27 '19 at 20:57

To remove a repository, you have to do 2 things:

  • Remove it from sources.list.

    If it was added by add-apt-repository then you will find it in its own file in /etc/apt/sources.list.d, not in the main sources.list.

    sudo rm /etc/apt/sources.list.d/nemh-systemback-precise.list
  • Optional: Stop trusting the key

    Use apt-key list to list trusted keys. Look for an entry like "Launchpad PPA for Kendek" in this case. Then use apt-key del to delete it:

    sudo apt-key del 73C62A1B
  • Thank you for your clear answer! I deleted the package. The key was not remove. So I will delete the key too then, since do not want anything unnecessary left to my system. Any tool which does both? – Léo Léopold Hertz 준영 Jul 30 '15 at 20:04
  • 13
    Note: the short key id is no longer shown when you use the apt-key list command, but it is actually the last 8 characters of the long key that is shown. – Mike Nakis Apr 6 '19 at 10:04
  • 1
    There is nothing in my /etc/apt/sources.list.d/ and I still have errors caused by running add-apt-repository of a broken mirror – Freedo May 23 '19 at 7:56
  • 43
    The command is sudo add-apt-repository -r <the repo you want to remove>. – SeF Oct 4 '19 at 8:00
  • 1
    Thanks @SeF. That is the correct answer. – fourpastmidnight Dec 6 '19 at 20:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.