#linux #apt

To uninstall a custom installed apt source and its signing key, do the following:

  1. List all apt sources: You can list all apt sources by running:
    ls /etc/apt/sources.list.d/
  2. Remove the desired source: To remove the specific source, use:
    sudo rm /etc/apt/sources.list.d/<source.list>
  3. Remove the signing key: If the signing key is stored in a keyring file, you can remove it with:
    sudo rm /usr/share/keyrings/<source name>.asc
    # or
    sudo rm /etc/apt/trusted.gpg.d/<source name.gpg
  4. Update the package list: After removing the source and its key, it's a good practice to update your package list:
    sudo apt update