我一直在尝试在 Ubuntu 上更新 apt-get,但尽管查看了类似问题的各种不同解决方案,但还是失败了。
我正在运行以下命令...
sudo apt-get update
我收到了以下输出...
Get:9 http://apt.typesafe.com unicorn InRelease [7,185 B]
Err:9 http://apt.typesafe.com unicorn InRelease
The following signatures were invalid: D2E3915347209000FA1C06D47CF8D72BE29DF322
...
W: GPG error: http://apt.typesafe.com unicorn InRelease: The following signatures were invalid: D2E3915347209000FA1C06D47CF8D72BE29DF322
E: The repository 'http://apt.typesafe.com unicorn InRelease' is not signed.
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.
我已经尝试重新下载密钥,但仍然不起作用。
编辑:安装该软件包后,我收到了相同的错误......
smrk007@Atticus:~/Downloads$ sudo dpkg -i repo-deb-build-0002.deb
(Reading database ... 201875 files and directories currently installed.)
Preparing to unpack repo-deb-build-0002.deb ...
Unpacking typesafe-repo (2.0-build-0003) over (2.0-build-0003) ...
Setting up typesafe-repo (2.0-build-0003) ...
Warning: The postinst maintainerscript of the package typesafe-repo
Warning: seems to use apt-key (provided by apt) without depending on gnupg or gnupg2.
Warning: This will BREAK in the future and should be fixed by the package maintainer(s).
Note: Check first if apt-key functionality is needed at all - it probably isn't!
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package typesafe-repo)
OK
smrk007@Atticus:~/Downloads$ sudo apt-get update
Ign:1 https://dl.bintray.com/sbt/debian InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 https://dl.bintray.com/sbt/debian Release [815 B]
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:7 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
Get:9 http://apt.typesafe.com unicorn InRelease [7,185 B]
Err:9 http://apt.typesafe.com unicorn InRelease
The following signatures were invalid: D2E3915347209000FA1C06D47CF8D72BE29DF322
为了提供更多背景信息,我试图在发生此错误之前安装 sbt 命令行工具来使用 scala。
答案1
尝试这个:
sudo rm -rf /var/lib/apt/lists
基本上从 apt 目录中删除所有列表文件夹。
使用以下命令添加列表目录:
sudo mkdir /var/lib/apt/lists
然后尝试以下命令:
sudo apt-get update