161

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?

0

1 Answer 1

253

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
    
5
  • 21
    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, 2019 at 10:04
  • 101
    The command is sudo add-apt-repository -r <the repo you want to remove>.
    – SeF
    Oct 4, 2019 at 8:00
  • 10
    I think @SeF you should make your comment an actual answer as that should be the accepted answer to this question. As a comment, albeit with high vote count, it is not given the attention it deserves.
    – Timo
    Apr 17, 2021 at 19:46
  • 2
    Thanks @Timo, unfortunately no new answers are allowed for this old question.
    – SeF
    Apr 18, 2021 at 21:02
  • 1
    Oh I see this has been flagged as a duplicate
    – Timo
    Apr 20, 2021 at 5:20

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