- List all apt sources: You can list all apt sources by running:
ls /etc/apt/sources.list.d/
- Remove the desired source: To remove the specific source, use:
sudo rm /etc/apt/sources.list.d/<source.list>
- 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
- Update the package list: After removing the source and its key, it's a good practice to update your package list:
sudo apt update