4090服务器无法sudo apt update 问题解决

报错

复制代码
(base) tayoadmin@Nvidia-GPU-Server:~$ sudo apt update
Get:1 https://mirrors.aliyun.com/ubuntu focal InRelease [265 kB]
Get:2 https://mirrors.aliyun.com/ubuntu focal-updates InRelease [128 kB]
Get:3 https://mirrors.aliyun.com/ubuntu focal-backports InRelease [128 kB]
Get:4 https://mirrors.aliyun.com/ubuntu focal-security InRelease [128 kB]
Err:1 https://mirrors.aliyun.com/ubuntu focal InRelease
  Unknown error executing apt-key
Err:2 https://mirrors.aliyun.com/ubuntu focal-updates InRelease
  Unknown error executing apt-key
Err:3 https://mirrors.aliyun.com/ubuntu focal-backports InRelease
  Unknown error executing apt-key
Err:4 https://mirrors.aliyun.com/ubuntu focal-security InRelease
  Unknown error executing apt-key
Reading package lists... Done
W: GPG error: https://mirrors.aliyun.com/ubuntu focal InRelease: Unknown error executing apt-key
E: The repository 'https://mirrors.aliyun.com/ubuntu focal 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.
W: GPG error: https://mirrors.aliyun.com/ubuntu focal-updates InRelease: Unknown error executing apt-key
E: The repository 'https://mirrors.aliyun.com/ubuntu focal-updates 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.
W: GPG error: https://mirrors.aliyun.com/ubuntu focal-backports InRelease: Unknown error executing apt-key
E: The repository 'https://mirrors.aliyun.com/ubuntu focal-backports 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.
W: GPG error: https://mirrors.aliyun.com/ubuntu focal-security InRelease: Unknown error executing apt-key
E: The repository 'https://mirrors.aliyun.com/ubuntu focal-security 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.
(base) tayoadmin@Nvidia-GPU-Server:~$ ^C

解决办法:

步骤 1:导出系统密钥到标准位置

复制代码
# 确保 keyring 文件存在
sudo cp /etc/apt/trusted.gpg /usr/share/keyrings/ubuntu-archive-keyring.gpg

步骤 2:修改软件源配置,使用 signed-by

复制代码
sudo nano /etc/apt/sources.list






#将每一行源(如 https://mirrors.aliyun.com/ubuntu focal)修改为:

deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://mirrors.aliyun.com/ubuntu/ focal main restricted
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://mirrors.aliyun.com/ubuntu/ focal-security main restricted

步骤 3:清理缓存并更新

复制代码
sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
sudo apt update
相关推荐
zcz16071278211 分钟前
服务器与客户端
运维·服务器
门思科技35 分钟前
LoRaWAN 的网络拓扑全解析:架构、原理与应用实践
服务器·网络·人工智能·科技·物联网·架构
我的收藏手册44 分钟前
Linux 网络命令大全
linux·服务器·网络
xx.ii1 小时前
28.Linux :通过源代码编译安装lamp
linux·运维·服务器
焊锡与代码齐飞1 小时前
嵌入式第三十五课!!Linux下的网络编程
linux·运维·服务器·开发语言·网络·学习·算法
2501_927773072 小时前
Linux操作系统编程——网络
linux·运维·网络
jiunian_cn2 小时前
【Linux】线程
android·linux·运维·c语言·c++·后端
喜欢你,还有大家2 小时前
Linux笔记8——shell编程基础-2
linux·服务器·笔记
泽虞2 小时前
《LINUX系统编程》笔记p3
linux·运维·服务器·c语言·笔记·面试
苹果醋34 小时前
Java并发编程-Java内存模型(JMM)
java·运维·spring boot·mysql·nginx