我曾尝试通过终端安装 Unity2d/3d,以便更轻松地使用终端,但遇到了一个问题,当我尝试通过终端进行更新时,会出现 unity2d/3d 错误。我复制了使用 sudo apt update 后的输出:
点击数:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease 点击数:2 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease 点击数:3 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease 点击数:4 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease 点击数:6 http://security.ubuntu.com/ubuntu focus-security InRelease 获取:5 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease [2,739 B] 错误:5 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease 由于公钥不可用,无法验证以下签名:NO_PUBKEY BE3E6EA534E8243F 正在读取软件包列表...完成 宽:GPG 错误:https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease:无法验证以下签名,因为公钥不可用:NO_PUBKEY BE3E6EA534E8243F 埃:存储库“https://hub.unity3d.com/linux/repos/deb stable InRelease”未签名。 N:从这样的存储库进行更新并不安全,因此默认情况下是禁用的。 N:请参阅 apt-secure(8) 手册页以了解存储库创建和用户配置详细信息。
我正在查看终端上的历史记录,希望能够看到我是否输入了错误的命令,虽然我没有看到任何错误,但我注意到我确实使用了相同的命令两次,这会是我收到上述错误代码的原因吗?
我正在使用 Ubuntu 20.04.4 LTS 64 位 3.36.8
答案1
总结
wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | sudo tee /usr/share/keyrings/Unity_Technologies_ApS.gpg > /dev/null
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
sudo apt update
sudo apt-get install unityhub
问题
“在 Linux 上安装 Unity Hub“Unity 文档的部分。
对于第 2 步,我们将 Unity 存储库添加到 Apt 列表,文档说明了以下命令:
sudo sh -c 'echo "deb [signedby=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
但是,当您使用更新源列表时,sudo apt update
您将收到以下错误:
Err:14 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BE3E6EA534E8243F
解决方案
命令有误。步骤 2 实际上应为:(signedby
实际上应为signed-by
)
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
这将解决该sudo apt update
命令并允许安装 Unity Hub。
答案2
上面的 Unity 论坛链接中的重要内容: https://forum.unity.com/threads/keyring-error.1290203/
wget -o- https://hub.unity3d.com/linux/keys/public
file public
gpg --no-default-keyring --keyring ./unity_keyring.gpg --import public
gpg --no-default-keyring --keyring ./unity_keyring.gpg --export > ./unity-archive-keyring.gpg
sudo mv ./unity-archive-keyring.gpg /etc/apt/trusted.gpg.d/
sudo apt update
sudo apt-get install unityhub
答案3
与@gencoreoperative 不同,对此的更改signedby
解决signed-by
了这个问题。
我的情况正好相反:使用signedby
而不是signed-by
。
我的系统:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal