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
相关推荐
k***92167 分钟前
【Linux】进程概念(六):地址空间核心机制
linux·运维·算法
李白同学12 分钟前
Linux:调试器-gdb/cgdb使用
linux·服务器·c语言·c++
保持低旋律节奏17 分钟前
linux——进程调度(时间片+优先级轮转调度算法O(1))
linux·运维·算法
Dobby_0533 分钟前
【k8s】集群安全机制(二):鉴权
运维·安全·kubernetes
街灯L1 小时前
【Ubuntu】Python uploadserver 文件传输服务器
linux·服务器·ubuntu
A13247053121 小时前
SSH远程连接入门:安全高效地管理服务器
linux·运维·服务器·网络·chrome·github
Tjohn91 小时前
阿里云服务器yum install后服务器卡死,无法ssh
服务器·阿里云·ssh
郝学胜-神的一滴1 小时前
深入解析Linux的`pthread_create`函数:从原理到实践
linux·服务器·c++·程序人生
yenggd1 小时前
企业总部-分支-门点-数据中心使用骨干网SRv6 BE互联互通整体架构配置案例
运维·网络·计算机网络·华为·架构
Hello.Reader1 小时前
Flink SQL CALL 语句调用存储过程做数据操作与运维任务(含 Java 示例 + 避坑指南)
运维·sql·flink