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
相关推荐
一水鉴天12 小时前
整体设计 定稿 之1 devOps 中台的 结论性表述(豆包助手)
服务器·数据库·人工智能
1***y17812 小时前
DevOps在云中的Rancher
运维·rancher·devops
tianyuanwo12 小时前
多平台容器化RPM构建流水线全指南:Fedora、CentOS与Anolis OS
linux·运维·容器·centos·rpm
wasp52013 小时前
做了技术管理后,我发现技术和管理其实可以兼得
java·运维·网络
云和数据.ChenGuang13 小时前
mysqld.service is not a native service问题解决!
运维·nginx·运维技术·运维工程师技术
写代码的学渣14 小时前
ubuntu 22.04 新装的系统 xshell 连不上
linux·运维·ubuntu
2501_9418059314 小时前
深入解析现代多语言后端架构设计:Python、Java、C++与Go在高性能服务中的实践
运维
F***E23914 小时前
如何安装配置Goland并使用固定公网地址SSH远程连接本地服务器
运维·服务器·ssh
序属秋秋秋14 小时前
《Linux系统编程之进程环境》【环境变量】
linux·运维·服务器·c语言·c++·操作系统·系统编程
云边有个稻草人15 小时前
手机也能控 Linux?Cpolar+JuiceSSH 搞定内网远程
运维·服务器·cpolar