How do I remove a repository from the terminal?

apt
34,653

Solution 1

You would need to locate the specific lines in /etc/apt/sources.list

Open the sources file with some editor while using sudo, such as vim (I personally use nano, but you can use whatever you want):

sudo vim /etc/apt/sources.list

Locate the lines which contain the broken link, and remove them. Save the files, then run sudo apt-get update after you save the file and close out the editor. Your sources will be updated to work with the non-broken repositories.

Note that if the lines don't show up in /etc/apt/sources.list then they'll exist in other files in /etc/apt/sources.list.d/ in which case you'll have to go through the files in that directory and comment out the broken source definition there.

Solution 2

If you need to manage PPAs then this question is for you:

Share:
34,653

Related videos on Youtube

Alvar
Author by

Alvar

Updated on September 18, 2022

Comments

  • Alvar
    Alvar about 1 year

    I have a Banshee link that is wrong and I need to remove it, how do I do it from the Terminal? I have the incorrect link, I have the correct one as well.

  • bitwelder
    bitwelder over 12 years
    Note: it is possible that the repositories are not only written in the single file /etc/apt/sources.list, but distributed in several files (one per repository) inside the directory /etc/apt/sources.list.d/
  • Thomas Ward
    Thomas Ward over 12 years
    True, but the first place to look would be /etc/apt/sources.list
  • Admin
    Admin over 1 year
    this work for me, thank you