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
相关推荐
伯恩bourne4 分钟前
Qdrant 快速入门 :数据模型介绍
服务器·数据库·人工智能
z落落5 分钟前
C#简易聊天室(服务器+客户端)
运维·服务器·c#
爱喝水的鱼丶12 分钟前
SAP-ABAP: BAdI 开发规范与避坑指南:10 类典型错误与运维方案
运维·性能优化·sap·abap·增强·经验交流·开发交流
CDN36013 分钟前
CDN 回源负载均衡实战:解决多源站回源流量不均、源站单点故障,出海业务配置指南
运维·负载均衡
吴声子夜歌16 分钟前
编写Shell脚本——启动项目
linux·运维·shell
拦路雨g17 分钟前
docker_data.vhdx大文件瘦身
运维·docker·容器
闲云野鹤在人间26 分钟前
云计算入门|网络与存储云服务知识梳理
linux·运维·服务器·网络·centos·云计算·php
好评12440 分钟前
【Linux】五种IO模型与非阻塞IO
linux·服务器·nat
水母量化43 分钟前
自动化开盘卖出如何适应价格笼子规则
运维·自动化·区块链·量化交易
码农阿豪44 分钟前
不装 SSH 客户端也能连服务器:用 WebSSH 把终端搬进浏览器
运维·服务器·ssh