Snippet: How to Remove Repositories In Ubuntu

In all our previous articles, we taught you how to add repositories to your system so that you can install third party software. What about the other way round?  There are times when you uninstall an application and have no more use for its repository. It is a good idea to remove the repository from your system and keep your computer spick and span.

Here’s how you can do it easily, in less than a minute:

Removing repository from the sources.list file

If you have previously added the repository via the sources.list file, the best way to remove the repository is to remove the respective line from your sources.list file.

Open your sources.list file

gksu gedit /etc/apt/sources.list

Scroll down to the repository that you want to remove.

Delete the line of code.

Save the file and exit.

Update your system:

sudo apt-get update


Removing repository from Synaptic Package Manager

If you have used the command ‘add-apt-repository’ to add repository to your system, you will not be able to find the line in your sources.list file. In such case, you might want to remove your repository via the Synaptic Package Manager.

Open Synaptic Package Manager (System -> Administration -> Synaptic Package Manager)

In the menu, go to  Settings -> Repositories. Click on the Other Software tab.

Scroll down the list till you find the repository that you want to remove. Highlight it and click the Remove button


Click Close.

When you are back to the Synaptic main screen, click the Reload button to update your system.

That’s it.

Snippet is a short tip/trick or just a quick fix for a certain issue that we discover from time to time. Don’t forget to subscribe to our RSS feed for more up to date tutorials/tips/tricks.


Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox