How to Remove a Repository from Raspbian

Sometimes, especially after uninstalling a program, you may need to manually remove a repository from the lists the Raspberry Pi uses when updating.
These repository lists are stored in two locations. The first can be edited with the nano editor from the terminal using the following command:

sudo nano /etc/apt/sources.list

once you have removed or commented out the line for the repository in question, close and save the file.

If the repository does not appear in the sources.list file, you can check whether it is in the sources.list.d directory with the following command:

sudo ls -al /etc/apt/sources.list.d/

If you have found the source you want to remove, you can delete it with the following command (in the following example, the NodeJS source repository is removed):

sudo rm /etc/apt/sources.list.d/nodesource.list

Enjoy!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top