ubuntu执行apt update报错
报错
root@ubuntu2004:/# apt update
Err:1 http://wiki.t-firefly.com/firefly-ubuntu-repo focal InRelease
Temporary failure resolving 'wiki.t-firefly.com'
Err:2 http://wiki.t-firefly.com/firefly-rk3588-repo focal InRelease
Temporary failure resolving 'wiki.t-firefly.com'
Err:3 http://mirrors.ustc.edu.cn/ubuntu-ports focal InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:5 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:6 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:7 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Reading package lists... Done
Building dependency tree
Reading state information... Done
132 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://wiki.t-firefly.com/firefly-ubuntu-repo/dists/focal/InRelease Temporary failure resolving 'wiki.t-firefly.com'
W: Failed to fetch http://wiki.t-firefly.com/firefly-rk3588-repo/dists/focal/InRelease Temporary failure resolving 'wiki.t-firefly.com'
W: Failed to fetch http://mirrors.ustc.edu.cn/ubuntu-ports/dists/focal/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://mirrors.ustc.edu.cn/ubuntu-ports/dists/focal-updates/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://mirrors.ustc.edu.cn/ubuntu-ports/dists/focal-backports/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://mirrors.ustc.edu.cn/ubuntu-ports/dists/focal-security/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/focal/InRelease Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.
解决
从你给出的错误信息来看,apt update 过程中出现了证书验证失败以及 Release 文件无效的问题,下面为你详细分析并提供解决办法:
1. 证书验证失败问题
错误信息显示 https://wiki.t-firefly.com 的证书验证失败,这可能是因为证书未生效、不受信任或者系统时间设置有误。
检查系统时间
证书的有效性和系统时间密切相关。若系统时间设置不正确,就可能导致证书验证失败。你可以使用以下命令查看系统时间:
date
若时间不准确,可使用 timedatectl 命令来设置系统时间和时区,例如设置为上海时区:
sudo timedatectl set-timezone Asia/Shanghai
sudo timedatectl set-ntp true
set-ntp true 会让系统通过网络时间协议(NTP)自动同步时间。设置完成后,再次运行 apt update 命令。
临时忽略证书验证
若上述方法无法解决问题,你可以临时忽略证书验证,但这会存在一定的安全风险。编辑 /etc/apt/apt.conf.d/99verify-peer.conf 文件:
sudo nano /etc/apt/apt.conf.d/99verify-peer.conf
添加以下内容:
Acquire::https::wiki.t-firefly.com::Verify-Peer "false";
Acquire::https::wiki.t-firefly.com::Verify-Host "false";
保存文件后,再次运行 apt update 命令。
2. Release 文件无效问题
错误信息显示多个软件源的 Release 文件尚未生效,这通常是由于系统时间设置不正确或者软件源同步延迟导致的。
再次检查系统时间
确保系统时间准确无误,因为 Release 文件的有效期是和系统时间进行比较的。若时间不准确,就会出现文件未生效的错误。
手动更新 Release 文件
有时候,软件源的同步可能会有延迟。你可以等待一段时间后再次运行 apt update 命令,或者尝试手动删除缓存并更新:
sudo rm -rf /var/lib/apt/lists/*
sudo apt update
3. 缺少 Release 文件问题
错误信息显示 http://wiki.t-firefly.com 的两个软件源缺少 Release 文件,这可能是软件源配置有误或者该软件源本身存在问题。
检查软件源配置
编辑 /etc/apt/sources.list 或者 /etc/apt/sources.list.d/ 目录下的相关文件,检查是否存在错误的软件源配置。若不确定某个软件源是否可用,可以暂时将其注释掉:
sudo nano /etc/apt/sources.list
在需要注释的软件源行前添加 # 符号,保存文件后,再次运行 apt update 命令。
按照以上步骤操作,你应该就能解决 apt update 过程中出现的问题。若问题仍然存在,可能需要进一步检查软件源的配置或者联系软件源的维护者。
报错
root@ubuntu2004:/# apt update
Get:2 http://mirrors.ustc.edu.cn/ubuntu-ports focal InRelease [265 kB]
Get:4 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates InRelease [128 kB]
Get:1 https://wiki.t-firefly.com:443/firefly-ubuntu-repo focal InRelease [2,589 B]
Get:5 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports InRelease [128 kB]
Get:3 https://wiki.t-firefly.com:443/firefly-rk3588-repo focal InRelease [1,852 B]
Get:6 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security InRelease [128 kB]
Get:7 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease [18.1 kB]
Get:8 http://mirrors.ustc.edu.cn/ubuntu-ports focal/main arm64 Packages [940 kB]
Get:9 http://mirrors.ustc.edu.cn/ubuntu-ports focal/main Translation-en [506 kB]
Err:1 https://wiki.t-firefly.com:443/firefly-ubuntu-repo focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BA034B64648B0073
Get:10 http://mirrors.ustc.edu.cn/ubuntu-ports focal/restricted arm64 Packages [1,300 B]
Get:11 http://mirrors.ustc.edu.cn/ubuntu-ports focal/restricted Translation-en [6,212 B]
Get:12 http://mirrors.ustc.edu.cn/ubuntu-ports focal/universe arm64 Packages [8,458 kB]
Err:3 https://wiki.t-firefly.com:443/firefly-rk3588-repo focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BA034B64648B0073
Get:13 http://mirrors.ustc.edu.cn/ubuntu-ports focal/universe Translation-en [5,124 kB]
Get:14 http://mirrors.ustc.edu.cn/ubuntu-ports focal/multiverse arm64 Packages [114 kB]
Get:15 http://mirrors.ustc.edu.cn/ubuntu-ports focal/multiverse Translation-en [104 kB]
Get:16 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/main arm64 Packages [2,961 kB]
Get:17 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main arm64 Packages [29.6 kB]
Get:18 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/main Translation-en [582 kB]
Get:19 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/restricted arm64 Packages [53.4 kB]
Get:20 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/restricted Translation-en [510 kB]
Get:21 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/universe arm64 Packages [1,184 kB]
Get:22 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/universe Translation-en [302 kB]
Get:23 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/multiverse arm64 Packages [20.0 kB]
Get:24 http://mirrors.ustc.edu.cn/ubuntu-ports focal-updates/multiverse Translation-en [8,920 B]
Get:25 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports/main arm64 Packages [45.4 kB]
Get:26 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports/main Translation-en [16.3 kB]
Get:27 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports/universe arm64 Packages [24.3 kB]
Get:28 http://mirrors.ustc.edu.cn/ubuntu-ports focal-backports/universe Translation-en [16.3 kB]
Get:29 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/main arm64 Packages [2,647 kB]
Get:30 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main Translation-en [5,892 B]
Get:31 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/main Translation-en [501 kB]
Get:32 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/restricted arm64 Packages [53.2 kB]
Get:33 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/restricted Translation-en [488 kB]
Get:34 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/universe arm64 Packages [960 kB]
Get:35 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/universe Translation-en [220 kB]
Get:36 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/multiverse arm64 Packages [7,264 B]
Get:37 http://mirrors.ustc.edu.cn/ubuntu-ports focal-security/multiverse Translation-en [6,448 B]
Reading package lists... Done
W: GPG error: https://wiki.t-firefly.com:443/firefly-ubuntu-repo focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BA034B64648B0073
E: The repository 'http://wiki.t-firefly.com/firefly-ubuntu-repo 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://wiki.t-firefly.com:443/firefly-rk3588-repo focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BA034B64648B0073
E: The repository 'http://wiki.t-firefly.com/firefly-rk3588-repo 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.
解决
从你提供的错误信息来看,主要问题是 https://wiki.t-firefly.com 相关的软件源签名无法验证,因为缺少对应的公钥。为了让 apt 能够安全地使用这些软件源,你需要导入缺失的公钥。以下是具体的解决步骤:
- 获取公钥:根据错误信息,缺失的公钥指纹是
BA034B64648B0073。你可以通过apt-key工具来导入这个公钥。运行以下命令:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA034B64648B0073
这个命令会从 keyserver.ubuntu.com 密钥服务器上获取指定的公钥,并将其添加到系统的密钥环中。
- 更新软件源列表:导入公钥后,你需要再次运行
apt update命令,让系统重新读取软件源列表并验证签名。运行以下命令:
sudo apt update
- 检查结果:运行
apt update后,查看输出信息,确认是否还存在与https://wiki.t-firefly.com相关的错误。如果公钥导入成功,系统应该能够正确验证软件源的签名,并且不再显示关于NO_PUBKEY的错误信息。
如果上述步骤无法解决问题,可能是密钥服务器暂时不可用或者公钥本身存在问题。在这种情况下,你可以尝试使用其他密钥服务器,例如 pgp.mit.edu,命令如下:
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys BA034B64648B0073
然后再次运行 apt update 检查结果。
希望这些步骤能够帮助你解决软件源签名验证的问题。

浙公网安备 33010602011771号