我访问的所有密钥服务器都超时了。我需要在不检查公钥签名的情况下安装软件包。有没有办法绕过所有签名检查/忽略所有签名错误或愚蠢地认为签名通过了?
Lek*_*eyn 86
将--allow-unauthenticated选项传递给apt-get如下:
sudo apt-get --allow-unauthenticated upgrade
Run Code Online (Sandbox Code Playgroud)
从 tha 手册页apt-get:
--allow-unauthenticated
如果包无法通过身份验证,则忽略并且不提示。这对于像 pbuilder 这样的工具很有用。配置项:APT::Get::AllowUnauthenticated。
您可以通过在/etc/apt/apt.conf.d/dir 中使用您自己的配置文件来使此设置永久化。文件名可以是99myown并且它可能包含以下行:
APT::Get::AllowUnauthenticated "true";
Run Code Online (Sandbox Code Playgroud)
这样,您就不必每次要安装软件时都使用该选项。注意:我不建议默认设置此选项,它会绕过可能允许对手破坏您计算机的签名检查。
dra*_*788 13
如果您试图从他们打包密钥的存储库中获取包并将它们包含在存储库中而不是其他任何地方,则使用 dpkg 下载和安装密钥/密钥环包可能会非常烦人,而且很难这样做以易于编写脚本和可重复的方式。
如果您可以从密钥服务器安装密钥或通过 https 从受信任的来源下载它们,则不建议使用以下脚本,但如果您没有任何其他方式,则可以使用它。
echo "deb http://your.repo.domain/repository/ $(lsb_release -c -s) universe" | sudo tee /etc/apt/sources.list.d/your-repo-name.list
sudo apt -o Acquire::AllowInsecureRepositories=true \
-o Acquire::AllowDowngradeToInsecureRepositories=true \
update
## if the 'apt update' above fails it is likely due to previously
## having the GPG key and repository on the system, you can clean
## out the old lists with `sudo rm /var/lib/apt/lists/your.repo.domain*`
apt-get -o APT::Get::AllowUnauthenticated=true install repo-keyring-pkgname
## If you ever run `sudo apt-key del your-repos-keyID`
## you may have to `sudo apt remove --purge repo-keyring-pkgname`
## Update should run without the GPG warnings now that the key is installed
apt-get update
apt-get install somepkg-from-repo
Run Code Online (Sandbox Code Playgroud)
我最初把它放在一起是因为他们的 sur5r 存储库中的 i3 是这样做的,但后来我发现他们的密钥在 keyserver.ubuntu.com 列表中,所以我sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E3CA1A89941C42E6可以避免所有额外的包麻烦。
Gnu*_*sam 13
我在旧的 Debian 服务器上遇到了同样的问题。我无法做出一个
apt-get update
这给了我以下错误:
E: Release file expired, ignoring http://archive.debian.org/debian/dists/squeeze-lts/Release (invalid since 1183d 0h 2min 51s)
最后解决方案是添加以下内容:
Acquire::Check-Valid-Until false;
到 /etc/apt/apt.conf (如果不存在则创建它)。此后,错误变成了简单的警告。
我想它也可以在 ubuntu 上运行。
请注意,它部分不安全,但仍然比禁用签名检查更安全。
也许您可以尝试创建文件 /etc/apt/apt.conf (如果您创建它,它将被读取)并插入以下代码:
APT{Ignore {"gpg-pubkey"; }};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
236284 次 |
| 最近记录: |