(base) root@sh:/home/sh/cuda-driver# sudo apt-get update
Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 InRelease
Ign:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 InRelease
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release [574 B]
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release [574 B]
Err:3 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release.gpg
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2204/x86_64 InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
W: Failed to fetch file:/var/cuda-repo-10-2-local-10.2.89-440.33.01/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
W: Some index files failed to download. They have been ignored, or old ones used instead.
本地CUDA仓库(file:/var/cuda-repo-10-2-local-10.2.89-440.33.01
)的APT源,但是该源的GPG公钥(F60F4B3D7FA2AF80
)没有被添加到APT的信任密钥中。由于直接下载公钥的尝试失败了,我们可以采取另一种方法来解决这个问题。
解决步骤
方法1: 移除或禁用本地CUDA仓库
如果你已经成功从其他来源安装了CUDA,并且不再需要这个本地仓库,你可以考虑移除或禁用它。
-
查找仓库定义:首先,找到定义该本地仓库的列表文件。这些文件通常位于
/etc/apt/sources.list
或/etc/apt/sources.list.d/
目录下。你可以通过搜索包含cuda-repo-10-2-local
的文件来定位它。grep -r "cuda-repo-10-2-local" /etc/apt/sources.list /etc/apt/sources.list.d/
-
注释掉或删除仓库条目:一旦找到包含本地CUDA仓库的文件,你可以使用文本编辑器(如
nano
或vi
)来注释掉相关行(在行首添加#
)或直接删除这些行。例如,如果发现在
/etc/apt/sources.list.d/cuda.list
文件中有关于本地仓库的定义,你可以通过以下命令编辑该文件:sudo nano /etc/apt/sources.list.d/cuda.list
-
更新APT索引:编辑完成后,运行以下命令更新APT的软件包索引:
sudo apt-get update
方法2: 手动添加GPG公钥
如果你仍然需要这个本地CUDA仓库,你可以尝试手动添加缺失的公钥。
-
手动下载公钥:由于自动下载失败,你可以尝试从NVIDIA官方网站或其他可靠来源手动下载GPG公钥文件。如果官方网站提供了密钥下载链接,使用浏览器或
wget
、curl
等工具下载密钥文件到本地。 -
导入公钥到APT:下载公钥文件后,使用
apt-key
命令或将密钥文件放入/usr/share/keyrings/
并适当更新APT源配置来导入公钥。由于apt-key
已弃用,推荐的方法是将公钥文件放入/usr/share/keyrings/
,但这需要你的APT源配置中有signed-by
指向该密钥文件。
如果无法直接从NVIDIA下载公钥,且没有其他方式解决,可能需要联系NVIDIA客服或访问NVIDIA开发者论坛,寻找是否有其他用户遇到类似问题并找到了解决方案。
综上所述,推荐的首要步骤是尝试移除或禁用不再需要的本地CUDA仓库,以简化系统配置并避免未来的更新问题。如果确实需要该仓库,那么手动添加公钥是必要的步骤,但请确保公钥来源的安全性和可靠性。
参考地址:
https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/