无法纠正问题,您持有损坏的软件包 Ubuntu 20.04 LTS

无法纠正问题,您持有损坏的软件包 Ubuntu 20.04 LTS

在更新 Ubuntu 20.04 期间,我收到此信息:

sudo apt update
Hit:1 http://download.opensuse.org/repositories/home:/stevenpusser/xUbuntu_20.04  InRelease
Hit:2 http://deb.debian.org/debian buster InRelease                                                                                   
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease                                                                                
Hit:4 http://deb.debian.org/debian buster-updates InRelease                                                                           
Hit:5 https://brave-browser-apt-release.s3.brave.com stable InRelease                                                                 
Hit:6 https://linux.teamviewer.com/deb stable InRelease                                                                               
Hit:7 http://deb.debian.org/debian-security buster/updates InRelease                                                                  
Hit:8 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                              
Hit:9 http://archive.canonical.com/ubuntu focal InRelease                                             
Hit:10 http://archive.ubuntu.com/ubuntu focal-backports InRelease               
Hit:11 http://archive.ubuntu.com/ubuntu focal-security InRelease                
Hit:12 http://ppa.launchpad.net/openshot.developers/ppa/ubuntu focal InRelease
Hit:13 http://ppa.launchpad.net/phoerious/keepassxc/ubuntu focal InRelease
Hit:14 http://ppa.launchpad.net/ubuntuhandbook1/audacity/ubuntu focal InRelease
Hit:15 http://dl.google.com/linux/chrome/deb stable InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

然后我运行:

sudo apt list --upgradable
Listing... Done
libfile-fcntllock-perl/stable 0.22-3+b5 amd64 [upgradable from: 0.22-3build4]
python3-netifaces/stable 0.10.4-1+b1 amd64 [upgradable from: 0.10.4-1ubuntu4]

然后,我必须(在和 处upgrade结果相同):sudo apt dist-upgradesudo apt full-upgrade

sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

现在,我正在尝试手动重新安装这 2 个包,如下所示:

sudo apt install libfile-fcntllock-perl --reinstall
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:
 libfile-fcntllock-perl : Depends: perlapi-5.28.0
E: Unable to correct problems, you have held broken packages.


sudo apt install python3-netifaces --reinstall
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:
 python3-netifaces : Depends: python3 (< 3.8) but 3.8.2-0ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

寻找丑陋的包裹:

sudo apt search libfile-fcntllock-perl
Sorting... Done
Full Text Search... Done
libfile-fcntllock-perl/stable 0.22-3+b5 amd64 [upgradable from: 0.22-3build4]
  Perl module for file locking with fcntl(2)


sudo apt search python3-netifaces
Sorting... Done
Full Text Search... Done
python3-netifaces/stable 0.10.4-1+b1 amd64 [upgradable from: 0.10.4-1ubuntu4]
  portable network interface information - Python 3.x

我也尝试过sudo apt install -f

sudo apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

答案1

问题是我将 debian 存储库添加到我的 ubuntu,以便从那里安装一些软件包。这两个文件(libfile-fcntllock-perlpython3-netifaceswere)是意外从 debian 存储库更新的,但添加这些存储库是个坏主意,所以我最终重新安装了 ubuntu。

相关内容