删除 apt 存储库?

the*_*can 3 updates package-management apt add-apt-repository

不久前,我可能不小心添加了一个带有无效 URL 的 apt 存储库。现在,每次运行时sudo apt update,底部都会显示以下错误消息:

E: The repository 'http://archive.canonical.com (lsb_release Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)

我尝试过使用sudo add-apt-repository --remove 'http://archive.canonical.com (lsb_release Release',运行命令后没有任何区别。如何从我的 apt 存储库列表中删除此 url?

http://archive.canonical.com (lsb_release Release编辑:在我的 /etc/apt/sources.list 中找不到该网址

以下要点包含https://gist.github.com/MrSiliconGuy/4ae2c649e5133f7edff012bfd6483d70/etc/apt/sources.list的内容和输出sudo apt update

编辑:原来是这条线deb http://archive.canonical.com/ (lsb_release -sc) partner

apt 源文件中不能包含 shell 命令

小智 5

如果您使用的是 ubuntu 20,您可以转到 /etc/apt/sources.list.d/

在那里您将找到您添加的存储库。然后只需删除包含存储库名称的文件并再次运行 apt update 即可。