How to remove APT repository in Ubuntu

You can install packages from third party sources by adding their APT repositories to Ubuntu. If you do not want to keep them later, these packages can be removed and the repositories can be removed too.

If you remember the name of the repository, say ppa:joe/foobar, use this command:

$ sudo add-apt-repository --remove ppa:joe/foobar

The short -r can be used instead of --remove.

If you do not recall the name of the repository, go to /etc/apt/sources.list.d/ directory and remove the filename that matches the repository you want to remove. You will need to use sudo for this.

After removing the repository in either of the above ways, remember to update:

$ sudo apt-get update

Tried with: Ubuntu 14.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s