Ubuntu 20.04 中无法获取安全性未确定错误 [IP: 91.189.91.38 80]

kri*_*ade 18 upgrade updates package-management apt 20.04

首先我运行sudo apt updatesudo apt update工作正常,但运行后sudo apt upgrade出现以下错误。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-5.4.0-59 linux-headers-5.4.0-59-generic linux-image-5.4.0-59-generic linux-modules-5.4.0-59-generic linux-modules-extra-5.4.0-59-generic
The following packages will be upgraded:
  libasound2 libasound2-data libatopology2 libproxy1-plugin-gsettings libproxy1-plugin-networkmanager libproxy1v5 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
  linux-image-generic-hwe-20.04 linux-libc-dev nautilus-sendto python-apt-common python3-apt
13 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.5 kB/76.0 MB of archives.
After this operation, 360 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Ign:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Ign:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Ign:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
Get:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Err:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Run Code Online (Sandbox Code Playgroud)

结果cat /etc/apt/sources.list

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-5.4.0-59 linux-headers-5.4.0-59-generic linux-image-5.4.0-59-generic linux-modules-5.4.0-59-generic linux-modules-extra-5.4.0-59-generic
The following packages will be upgraded:
  libasound2 libasound2-data libatopology2 libproxy1-plugin-gsettings libproxy1-plugin-networkmanager libproxy1v5 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
  linux-image-generic-hwe-20.04 linux-libc-dev nautilus-sendto python-apt-common python3-apt
13 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.5 kB/76.0 MB of archives.
After this operation, 360 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Ign:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Ign:2 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Ign:3 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
Get:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
Get:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Err:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Run Code Online (Sandbox Code Playgroud)

结果sudo apt update --fix-missing

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
Run Code Online (Sandbox Code Playgroud)

结果sudo apt upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-5.4.0-59 linux-headers-5.4.0-59-generic linux-image-5.4.0-59-generic linux-modules-5.4.0-59-generic linux-modules-extra-5.4.0-59-generic
The following packages will be upgraded:
  libasound2 libasound2-data libatopology2 libproxy1-plugin-gsettings libproxy1-plugin-networkmanager libproxy1v5 linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
  linux-image-generic-hwe-20.04 linux-libc-dev nautilus-sendto python-apt-common python3-apt
13 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.5 kB/76.0 MB of archives.
After this operation, 360 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Ign:1 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
Get:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Ign:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Ign:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
Get:1 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2 [5,284 B]
Err:1 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.142 80]
Get:2 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2 [18.1 kB]
Err:2 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.142 80]
Get:3 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2 [49.1 kB]
Err:3 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libproxy1v5 amd64 0.4.15-10ubuntu1.2
  Undetermined Error [IP: 91.189.88.142 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-10ubuntu1.2_amd64.deb  Undetermined Error [IP: 91.189.88.142 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Run Code Online (Sandbox Code Playgroud)

Raf*_*ffa 20

通过在终端中运行以下命令,将存储库列表恢复为原始 Ubuntu Focal 列表:

sudo nano /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

将打开文件编辑器。删除其中的所有行,然后将以下内容复制并粘贴到文件编辑器中:

deb http://archive.ubuntu.com/ubuntu focal main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ focal-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu focal-updates main multiverse universe restricted
Run Code Online (Sandbox Code Playgroud)

Ctrl然后,按+X然后按Y然后按保存并关闭文件Enter

要验证您是否正确保存了文件,请在终端中运行以下命令:

cat /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

输出应该完全是:

deb http://archive.ubuntu.com/ubuntu focal main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ focal-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu focal-updates main multiverse universe restricted
Run Code Online (Sandbox Code Playgroud)

Ubuntu 存储库具有定义的格式。例如,它们应该是类似的东西deb http://archive.ubuntu.com/ubuntu bionic main

解释:

deb这些存储库包含二进制文件或预编译包。大多数用户都需要这些存储库。

http://archive.ubuntu.com/ubuntu URI(统一资源标识符),在本例中是互联网上的位置。

focal:是您的 Ubuntu 安装的发行版名称。

main& restricted...etc:是部分名称或组件。可以有多个部分名称,以空格分隔。

之后,请通过在终端中运行以下命令来清除 apt 缓存:

sudo apt clean && sudo apt autoclean
Run Code Online (Sandbox Code Playgroud)

然后通过在终端中运行以下命令来更新您的存储库列表:

sudo apt update
Run Code Online (Sandbox Code Playgroud)

您现在应该能够再次安装软件包并更新系统。

如果之后仍然出现错误,请首先/etc/apt/sources.list.d/在终端中运行以下命令备份到主目录:

mkdir ~/old_sources_list_d && sudo cp -r /etc/apt/sources.list.d/* ~/old_sources_list_d/
Run Code Online (Sandbox Code Playgroud)

之后,请/etc/apt/sources.list.d/通过在终端中运行以下命令来清除所有现有的 PPA 和存储库列表:

sudo rm -r /etc/apt/sources.list.d/*
Run Code Online (Sandbox Code Playgroud)

之后,请通过在终端中运行以下命令来清除 apt 缓存:

sudo apt clean && sudo apt autoclean
Run Code Online (Sandbox Code Playgroud)

然后,请在终端中再次运行以下命令来更新您的存储库列表:

sudo apt update
Run Code Online (Sandbox Code Playgroud)

注意:

  • 检查您的互联网连接是否位于防火墙后面、是否受到任何限制或位于代理后面,并相应地配置您的系统和连接,或者更改为其他连接(如果可用)。防火墙可以阻止对某些 URL 的访问,而代理可以在其缓存系统中保留旧的过时链接,这将导致目标损坏或无响应。代理还可以修改 HTTP 请求的标头并干扰 Web 服务器的响应并更改它们,您的计算机最终可能会收到 APT 无法正确处理的错误响应。这在由大量人员使用且出于可用性和安全原因而资源或互联网速度有限的网络中很常见。

  • 执行以下命令检查是否存在APT代理配置文件:

ls /etc/apt/apt.conf.d/*proxy*
Run Code Online (Sandbox Code Playgroud)

如果该命令返回任何结果,请将这些文件移出目录/etc/apt/apt.conf.d/或删除它们。


Bre*_*ton 5

摘自@krisna-kakade 的评论。

以下内容对我有用,无需采取进一步行动。

sudo apt update --fix-missing 
sudo apt upgrade
Run Code Online (Sandbox Code Playgroud)