如何关闭apt签名验证

图片[1]-如何关闭apt签名验证-云港网络

--allow-unauthenticated选项传递给,apt-get如:

sudo apt-get --allow-unauthenticated upgrade

从以下页面的手册中apt-get

–allow-unauthenticated
忽略是否​​无法对软件包进行身份验证,并且不提示输入。这对于pbuilder之类的工具很有用。配置项:APT :: Get :: Allow未经身份验证。

您可以通过在/etc/apt/apt.conf.d/dir中使用自己的配置文件使此设置永久化。文件名可以是99myown,并且可以包含以下行:

APT::Get::AllowUnauthenticated "true";

这样,您不需要每次都要安装软件时使用该选件。注意:我不建议默认情况下设置此选项,因为它会绕过签名检查,该检查可能会使对手破坏您的计算机。

如果您试图从存储库中获取软件包,在存储库中密钥被打包并包含在存储库中,而没有其他地方,那么使用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

我最初把它们放在一起是因为i3在他们的sur5r存储库中是这样做的,但是后来我发现它们的密钥在keyserver.ubuntu.com列表中,因此我sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E3CA1A89941C42E6可以避免所有额外的软件包麻烦。

© 版权声明
THE END
喜欢就支持一下吧
点赞10.4W+打赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容