0

When I look in my /etc/apt/sources.list.d directory, I have the following files:

bazel.list
bazel.list.save
deadsnakes-ubuntu-ppa-focal.list
google-cloud-sdk.list
google-cloud-sdk.list.save

Whenever I run sudo apt update, I get a bunch of errors related to the Bazel and Google Cloud repos, e.g.

An error occurred during the signature verification. The repository is not updated and the
previous index files will be used. GPG error: https://packages.cloud.google.com/apt cloud-sdk
InRelease: The following signatures couldn't be verified because the public key is not available:
NO_PUBKEY xxx NO_PUBKEY xxx

Rather than trying to fix that error, I really just want to wipe out all custom Apt sources and PPAs - I am also having some issues with the deadsnakes PPA interfering with system Python.

My question: What steps do I need to take to completely remove custom Apt sources from my Ubuntu installation? Is it enough to just delete the files in the /etc/apt/sources.list.d directory? Should I also run sudo add-apt-repository --remove? Are there GPG or other keys stored somewhere that I need to purge?

I did see How can PPAs be removed?, which gives me a clue about how to remove the deadsnakes PPA, but I'm still not sure about the Google lists.

I'm running Ubuntu 20.04.5 LTS on WSL 2.

2 Answers2

3
  • Open the tool "Software & Updates"
  • Head to the second tab, "Other Software".
  • Remove the checkmark before a source to disable it; select a software source and use the "Remove" button to completely remove the source.
  • Hit the "Close" button when done.
vanadium
  • 88,010
0

From the terminal run:

sudo mv /etc/apt/sources.list.d/bazel.list /etc/apt/sources.list.d/bazel.list.old

sudo mv /etc/apt/sources.list.d/google-cloud-sdk.list /etc/apt/sources.list.d/google-cloud-sdk.list.old

This will disable each repository file. You can then edit them and rename them back if you should like to do so in the future.

Artur Meinild
  • 26,018