即使更新后也无法从 apt-get 或 apt 下载任何内容?

即使更新后也无法从 apt-get 或 apt 下载任何内容?

经过一周的尝试,我甚至找不到通过 apt-get 或 apt 安装所需软件的方法。例如,在安装 thunar 时,出现此错误:

$ sudo apt install thunar
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package thunar is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'thunar' has no installation candidate

我尝试了以下方法:

  1. sudo apt-get update --fix-missing
  2. sudo apt-get upgrade
  3. sudo apt-get dist-upgrade
  4. sudo apt-get autoremove
  5. sudo apt-get -f install

但问题仍然存在。我怀疑这可能是由于 中存在大量混淆sources.list,所以我去了软件中心,通过选择 选项恢复了列表Best Server。然而,这根本没有帮助。事实上,当我尝试了两次并得到了两个不同的最佳服务器时,我怀疑这不是服务器的问题。

这是我的当前情况sources.list

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#


###### Ubuntu Main Repos
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial main restricted universe multiverse

###### Ubuntu Update Repos
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ xenial-proposed main restricted universe multiverse

#------------------------------------------------------------------------------#
#                           UNOFFICIAL UBUNTU REPOS                            #
#------------------------------------------------------------------------------#


###### 3rd Party Binary Repos

#### Wine PPA - https://launchpad.net/~ubuntu-wine/+archive/ppa/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 883E8688397576B6C509DF495A9A06AEF9CB8DB0
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial main


####### 3rd Party Source Repos

#### Wine PPA (Source) - https://launchpad.net/~ubuntu-wine/+archive/ppa/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 883E8688397576B6C509DF495A9A06AEF9CB8DB0
deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial main

从更新开始,我收到以下错误:

Err:102 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-security/main arm64 Packages                                                                                                                                                                                           
  404  Not Found [IP: 137.189.4.14 80]
Ign:112 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-security/universe arm64 Packages                                                                                                                                                                                       
Ign:63 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main DEP-11 64x64 Icons                                                                                                                                                                                     
Err:127 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-updates/main arm64 Packages                                                                                                                                                                                            
  404  Not Found [IP: 137.189.4.14 80]
Ign:137 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-updates/universe arm64 Packages                                                                                                                                                                                        
Ign:143 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-updates/multiverse arm64 Packages                                                                                                                                                                                      
Err:151 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-proposed/main arm64 Packages                                                                                                                                                                                           
  404  Not Found [IP: 137.189.4.14 80]
Ign:158 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-proposed/universe arm64 Packages                                                                                                                                                                                       
Err:64 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main Sources                                                                                                                                                                                                  
  404  Not Found
Ign:65 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main amd64 Packages                                                                                                                                                                                           
Ign:66 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main i386 Packages                                                                                                                                                                                            
Ign:67 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main arm64 Packages                                                                                                                                                                                           
Ign:68 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main all Packages                                                                                                                                                                                             
Ign:69 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main Translation-en_US                                                                                                                                                                                        
Ign:70 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main Translation-en                                                                                                                                                                                           
Ign:71 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main amd64 DEP-11 Metadata                                                                                                                                                                                    
Ign:72 http://ppa.launchpad.net/richardgv/compton/ubuntu xenial/main DEP-11 64x64 Icons                                                                                                                                                                                       
Err:73 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main Sources                                                                                                                                                                                             
  404  Not Found
Ign:83 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main amd64 Packages                                                                                                                                                                                      
Ign:84 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main i386 Packages                                                                                                                                                                                       
Ign:76 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main arm64 Packages                                                                                                                                                                                      
Ign:77 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main all Packages                                                                                                                                                                                        
Ign:78 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main Translation-en_US                                                                                                                                                                                   
Ign:85 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main Translation-en                                                                                                                                                                                      
Ign:80 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main amd64 DEP-11 Metadata                                                                                                                                                                               
Ign:81 http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial/main DEP-11 64x64 Icons                                                                                                                                                                                  
Fetched 37.2 MB in 1min 11s (520 kB/s)                                                                                                                                                                                                                                        
Reading package lists... Done
W: file:///var/cuda-repo-8-0-local/Release.gpg: Signature by key 889BEE522DA690103C4B085ED88C3D385C37D3BE uses weak digest algorithm (SHA1)
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_cuda-repo-8-0-local_Release
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_libopencv4tegra-repo_Release
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-repo_Release
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-sfm-repo_Release
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-tracking-repo_Release
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://build.openvpn.net/debian/openvpn/stable xenial Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8E6DA8B4E158C569
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://apt.dockerproject.org/repo ubuntu-xenial InRelease' doesn't support architecture 'arm64'
W: GPG error: http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A7D1D38BEB6D886
W: The repository 'http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Skipping acquire of configured file 'stable/binary-arm64/Packages' as repository 'https://www.perfect-privacy.com/repos/linux/debian perfect-privacy-vpn InRelease' doesn't support architecture 'arm64'
W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://ppa.launchpad.net/richardgv/compton/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Failed to fetch http://build.openvpn.net/debian/openvpn/stable/dists/xenial/Release.gpg  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8E6DA8B4E158C569
E: Failed to fetch http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/dists/xenial/main/binary-arm64/Packages  404  Not Found [IP: 137.189.4.14 80]
E: Failed to fetch http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/dists/xenial-security/main/binary-arm64/Packages  404  Not Found [IP: 137.189.4.14 80]
E: Failed to fetch http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/dists/xenial-updates/main/binary-arm64/Packages  404  Not Found [IP: 137.189.4.14 80]
E: Failed to fetch http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/dists/xenial-proposed/main/binary-arm64/Packages  404  Not Found [IP: 137.189.4.14 80]
E: Failed to fetch http://ppa.launchpad.net/mc3man/trusty-media/ubuntu/dists/xenial/main/source/Sources  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/richardgv/compton/ubuntu/dists/xenial/main/source/Sources  404  Not Found
E: Failed to fetch http://archive.ubuntukylin.com:10006/ubuntukylin/dists/xenial/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu/dists/xenial/main/source/Sources  404  Not Found
W: Some index files failed to download. They have been ignored, or old ones used instead.

并且即使将服务器更改为主服务器后,仍然会出现“无法获取”错误。我完全不知道为什么会发生这种情况。

我看过的主题:

  1. 选择最佳服务器:‘apt-get update’ 错误
  2. 清除有问题的软件包(本例中为 thunar):无法获取任何内容
  3. 未满足的依赖关系: 如何解决未满足的依赖项错误?

我能做些什么来解决这个问题?我目前只能依靠现有的软件包,在下载之前安装它们,但遇到了问题。希望有专家可以诊断并解决这个问题。

谢谢。

编辑1:为什么我的问题不是如何修复 GPG 错误“NO_PUBKEY”?

我尝试了该解决方案,但遇到了这个问题:

$ sudo apt-get install y-ppa-manager
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 y-ppa-manager : Depends: yad (>= 0.36.0) but it is not going to be installed
                 Depends: ppa-purge but it is not installable
                 Depends: xclip but it is not installable
E: Unable to correct problems, you have held broken packages.

使用软件和更新时出现其他错误,当应用程序要求我在更改服务器等之后重新加载时会发生这种情况:

W:Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:34 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:2, W:Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list.d/ubuntu-wine-ubuntu-ppa-xenial.list:1, W:Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/vertex-theme.list:1 and /etc/apt/sources.list.d/vertex-theme.list:2, W:Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/vertex-theme.list:1 and /etc/apt/sources.list.d/vertex-theme.list:2, W:file:///var/cuda-repo-8-0-local/Release.gpg: Signature by key 889BEE522DA690103C4B085ED88C3D385C37D3BE uses weak digest algorithm (SHA1), W:Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_cuda-repo-8-0-local_Release, W:Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_libopencv4tegra-repo_Release, W:Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-repo_Release, W:Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-sfm-repo_Release, W:Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_visionworks-tracking-repo_Release, W:Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://apt.dockerproject.org/repo ubuntu-xenial InRelease' doesn't support architecture 'arm64', W:GPG error: http://build.openvpn.net/debian/openvpn/stable xenial Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8E6DA8B4E158C569, W:The repository 'http://build.openvpn.net/debian/openvpn/stable xenial Release' is not signed., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., W:Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'http://build.openvpn.net/debian/openvpn/stable xenial InRelease' doesn't support architecture 'arm64', W:GPG error: http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A7D1D38BEB6D886, W:The repository 'http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04  Release' is not signed., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., W:Skipping acquire of configured file 'stable/binary-arm64/Packages' as repository 'https://www.perfect-privacy.com/repos/linux/debian perfect-privacy-vpn InRelease' doesn't support architecture 'arm64', W:The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., W:The repository 'http://ppa.launchpad.net/richardgv/compton/ubuntu xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., W:The repository 'http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., W:Failed to fetch http://....archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not resolve '....archive.ubuntu.com', W:Failed to fetch http://....archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not resolve '....archive.ubuntu.com', W:Failed to fetch http://....archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Could not resolve '....archive.ubuntu.com', W:Failed to fetch http://....archive.ubuntu.com/ubuntu/dists/xenial-proposed/InRelease  Could not resolve '....archive.ubuntu.com', E:Failed to fetch http://ppa.launchpad.net/mc3man/trusty-media/ubuntu/dists/xenial/main/source/Sources  404  Not Found, E:Failed to fetch http://ppa.launchpad.net/richardgv/compton/ubuntu/dists/xenial/main/source/Sources  404  Not Found, E:Failed to fetch http://ppa.launchpad.net/varlesh-l/papirus-pack/ubuntu/dists/xenial/main/source/Sources  404  Not Found, E:Failed to fetch http://archive.ubuntukylin.com:10006/ubuntukylin/dists/xenial/main/binary-arm64/Packages  404  Not Found, W:Some index files failed to download. They have been ignored, or old ones used instead.

答案1

您的软件源中存在一些错误,其中一些与将系统升级到 Xenial 有关。特别是,

http://ftp.cuhk.edu.hk没有针对 arm64 架构的版本,并且

http://ppa.launchpad.net/richardgv/compton
http://ppa.launchpad.net/varlesh-l/papirus-pack
http://ppa.launchpad.net/mc3man/trusty-media

没有 Xenial 的版本,其他几个也抱怨没有 arm64 版本。

最后,您包含了来自 OpenSuse 的几个档案,并且显然有一个 Cuda 的本地档案,它报告了一些错误。


快速解决: 打开“软件和更新”,转到Other Software选项卡并取消选中(禁用)报告不可用的第三方存档。如果您愿意,可以从 CLI 编辑/etc/apt/sources.list并在有问题的行上放置,但如果相应的行不存在,则#可能需要编辑中的文件/etc/apt/sources.list.d/etc/apt/sources.list


这会不是修复某些存储库报告它们没有 arm64 版本的问题:您应该评估您正在做的事情是否需要该体系结构,并可能从系统中删除该体系结构:

sudo dpkg --remove-architecture arm64

如果您已经安装了 arm64 软件包,则需要先将其删除:

sudo apt-get purge ".*:arm64"

更长的修复时间:正如您在评论中指出的那样,您需要保留一些使用 arm64 架构的软件包,因此您需要编辑每个来源/etc/apt/sources.list/etc/apt/sources.list.d/*.list中产生与 arm64 架构相关的错误,包括单词[arch=amd64][arch=amd64,i386]

例如,你必须在资料中找到一行

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-security main

并将此行更改为

deb [arch=amd64,i386] http://ftp.cuhk.edu.hk/pub/Linux/ubuntu xenial-security main

这将指示 apt 仅为该源加载 amd64 和 i386 架构,而不是尝试加载 arm64 架构(该架构不存在,这也是 apt 所警告的)


最后,如果您需要某些已停用源的包,例如 cuda 包,您将需要研究如何为您的 Xenial 系统适当地添加这些源。

相关内容