182

Please let me know how to remove certain repositories in Ubuntu 11.04. I am getting the following errors while updating.

sudo apt-get update

Err http://ppa.launchpad.net natty/main Sources                                   
  404  Not Found
Err http://ppa.launchpad.net natty/main i386 Packages                             
  404  Not Found
......

E: Some index files failed to download. They have been ignored, or old ones used instead.
0

3 Answers 3

269

Or from the terminal -

sudo add-apt-repository -r ppa:<ppa to remove>

Or, edit the /etc/apt/sources.list to find your ppa there, and remove from there manually (or automatically).

Or, remove the ppa file from /etc/apt/sources.list.d in newer versions of Ubuntu.

4
  • 2
    I believe this is the better answer because it's easier to automate and works on more platforms and installation types.
    – Kurt
    Feb 15, 2019 at 14:52
  • 1
    What is <ppa to remove>? Is it a name? It does not seem to be the URI. Apr 2, 2022 at 17:01
  • You can find all ppas by scanning /etc/apt/sources.list*.
    – KalEl
    Apr 3, 2022 at 18:32
  • FWIW, since there's still questions on this, I don't quite like the ppa management. I even less like the push to snap, because of so make inefficiencies it has. I've moved to Arch based Manjaro and have been happier ever since.
    – KalEl
    Apr 3, 2022 at 18:34
153

You can easily remove software repositories from the "Software & Updates"

  • Open "Software & Updates"

enter image description here

  • Select tab "Other Software"

enter image description here

From the "Other Software" tab you can add or remove repositories.

1
  • This can be found via the Ubuntu menu bar under "Applications > System Tools > Software". Then in the new window choose "Application > Software & Updates" in the menu bar. Jan 1, 2021 at 11:53
34

Using PPA Purge:

ppa-purge can remove a PPA and downgrade all the packages you've installed from that PPA to the newest version in your other repositories. This is the cleaner way of removing repos.

sudo apt-get install ppa-purge

via:WebUpd8

If you know the PPA address:

sudo ppa-purge ppa:<the PPA to purge>

Example:

sudo ppa-purge ppa:fcitx-team/nightly

If you don't know the PPA address:

You can also purge repositories that don't have the address in the correct format yet, by changing it. Change it from:

https://<ppa_host>/<ppa_owner>/<ppa_name>

to

sudo ppa-purge -s <ppa_host> ppa:<ppa_owner>/<ppa_name>

Example: If you want to remove WineHQ repo.

Find the correct file:

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

Get the address from that file:

cat /etc/apt/sources.list.d/dl_winehq_org_wine_builds_ubuntu.list

Change the address from:

deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main

to

sudo ppa-purge -s dl.winehq.org ppa:wine-builds/ubuntu

You can find a bit more info using man ppa-purge.

Via GUI:

Or you can go to Software Sources on the Ubuntu Software Center Edit menu, enter your password, go to the Other tab, look for the PPA you wan to remove, click remove and close, it will ask you to update the repos and done.

5
  • Is there a way to purge a repository that is not a PPA?
    – NobbZ
    Feb 6, 2015 at 14:32
  • @NobbZ you can just use Software Sources or edit the sources.list file. Feb 8, 2015 at 1:17
  • 7
    No, I want to PURGE it. This source has installed some mesa stuff, that is too new and so I can't install other stuff from canonicals repositories any more because of strict version constraints. That repository in question was preconfigured by the laptops manufacturer and I realized this problem far too late. Simply removing or deactivating this repository does not work, since apt keeps all the stuff that was already installed from that repo.
    – NobbZ
    Feb 8, 2015 at 12:19
  • @NobbZ 5 years and 2 month late, but I added an edit with instructions for that. :)
    – Carolus
    Apr 13, 2020 at 19:33
  • For me the address wasn't in the above format, it had an extra "/ubuntu" at the end that I had to ignore. Aug 7, 2022 at 7:21

Not the answer you're looking for? Browse other questions tagged .