我无法删除具有未满足依赖关系的软件包

我无法删除具有未满足依赖关系的软件包

编辑3:

这是命令之后sudo apt-get purge libpciaccess*

laur@laur-System-Product-Name:~$ sudo apt-get purge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).



laur@laur-System-Product-Name:~$ sudo apt-get purge libpciaccess*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libpciaccess0' for glob 'libpciaccess*'
Note, selecting 'libpciaccess-dev' for glob 'libpciaccess*'
Package 'libpciaccess-dev' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
intel-media-va-driver : Depends: libpciaccess0 but it is not going to 
be installed
libdrm-intel1 : Depends: libpciaccess0 but it is not going to be 
installed
spice-vdagent : Depends: libpciaccess0 but it is not going to be 
installed
ubuntu-drivers-common : Depends: libpciaccess0 (>= 0.10.7) but it is 
not going to be installed
xserver-xorg-core : Depends: libpciaccess0 (>= 0.12.902) but it is not 
going to be installed
xserver-xorg-video-ati : Depends: libpciaccess0 but it is not going to 
be installed
xserver-xorg-video-intel : Depends: libpciaccess0 (>= 
0.8.0+git20071002) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).

它们越来越多地出现...我也尝试安装适用于 Linux 的英特尔显卡,但不幸的是,安装没有成功。

编辑2:

laur@laur-System-Product-Name:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libpciaccess0
The following packages will be upgraded:
libpciaccess0
1 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
13 not fully installed or removed.
Need to get 0 B/17,9 kB of archives.
After this operation, 33,8 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 232583 files and directories currently 
installed.)
Preparing to unpack .../libpciaccess0_0.16-0ubuntu1_amd64.deb ...
Unpacking libpciaccess0:amd64 (0.16-0ubuntu1) over (0.14-1) ...
dpkg: error processing archive 
/var/cache/apt/archives/libpciaccess0_0.16-0ubuntu1_amd64.deb (-- 
unpack):
trying to overwrite shared 
'/usr/share/doc/libpciaccess0/changelog.Debian.gz', which is different 
 from other instances of package libpciaccess0:amd64
 Errors were encountered while processing:
 /var/cache/apt/archives/libpciaccess0_0.16-0ubuntu1_amd64.deb

 **E: Sub-process /usr/bin/dpkg returned an error code (1)**

我收到上述错误 ^

编辑 :

我通过@karel 提供的方法恢复了默认存储库,但仍然得到相同的输出:

laur@laur-System-Product-Name:~$ sudo apt-get upgrade
[sudo] password for laur: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpciaccess-dev : Depends: libpciaccess0 (= 0.16-0ubuntu1) but 0.14-1 
is installed
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).

下午好!我在使用 Ubuntu 20.04 时遇到了一个非常烦人的问题,我有一些软件包具有未满足的依赖关系,我尝试使用我在互联网上找到的所有方法来删除它们,但都没有按预期工作。

我只想修复此错误,以便安装 Linux 所需的一些升级

我试过了sudo apt --fix-broken install,但是没有用。

我是 Linux 发行版的新手,我只是想学习如何更好地使用它。

感谢您的任何帮助!

laur@laur-System-Product-Name:~$ sudo apt update
[sudo] password for laur: 
Hit:1 http://ro.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 https://repo.steampowered.com/steam stable InRelease                     
Hit:3 http://ro.archive.ubuntu.com/ubuntu focal-updates InRelease              
Hit:4 https://deb.nodesource.com/node_14.x focal InRelease                     
Hit:5 https://brave-browser-apt-release.s3.brave.com stable InRelease          
Hit:6 http://ro.archive.ubuntu.com/ubuntu focal-backports InRelease            
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [107 
kB]      
Hit:8 https://packages.microsoft.com/repos/ms-teams stable InRelease           
Fetched 107 kB in 1s (112 kB/s)                          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
laur@laur-System-Product-Name:~$ sudo apt list --upgradable
Listing... Done
aptdaemon-data/focal-updates,focal-updates,focal-security,focal- 
security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982- 
0ubuntu32]
aptdaemon/focal-updates,focal-updates,focal-security,focal-security 
1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982-0ubuntu32]
gdebi-core/focal,focal 0.9.5.7+nmu3 all [upgradable from: 
0.9.5.7+nmu3]
libpciaccess0/focal 0.16-0ubuntu1 amd64 [upgradable from: 0.14-1]
python3-aptdaemon.gtk3widgets/focal-updates,focal-updates,focal- 
security,focal-security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 
1.1.1+bzr982-0ubuntu32]
python3-aptdaemon/focal-updates,focal-updates,focal-security,focal- 
security 1.1.1+bzr982-0ubuntu32.2 all [upgradable from: 1.1.1+bzr982- 
0ubuntu32]
secureboot-db/focal-updates 1.6~20.04.1 amd64 [upgradable from: 1.5]

laur@laur-System-Product-Name:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.

The following packages have unmet dependencies:
libpciaccess-dev : Depends: libpciaccess0 (= 0.16-0ubuntu1) but 0.14-1 
is installed
libpciaccess0 : Breaks: libpciaccess0:i386 (!= 0.14-1) but 0.16- 
0ubuntu1 is installed
libpciaccess0:i386 : Breaks: libpciaccess0 (!= 0.16-0ubuntu1) but 
0.14-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages 
(or specify a solution).

答案1

首先尝试, sudo dpkg --configure -a

如果这不起作用,请aptitude使用apt-get

sudo aptitude install package_name_here

它会建议依赖项解决方案。尝试一下。如果其他一切都失败了,您需要手动编辑 dpkg 状态文件

sudo gedit /var/lib/dpkg/status

然后查找有问题的软件包名称。删除这些软件包并保存文件。然后更新并升级。

sudo apt-get update && upgrade

然后它将在更新期间安装所需的软件包。如果这不起作用,请告诉我。

答案2

在尝试了不同的解决方案之后,我找到了一个对我有帮助的解决方案。

  1. 我使用此处提供的解决方案恢复了 sources.list 文件回答

  2. 我使用这些命令恢复了状态文件这里

mv /var/lib/dpkg/status /var/lib/dpkg/status.old
ls -l /var/backups/dpkg.status*
cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

  1. 当我尝试安装 Intel Graphics For Linux 和其他一些我没有跟踪的程序时,我已经在系统上安装了 i386 架构。我使用以下命令将其删除:

sudo dpkg --remove-architecture i386

  1. 最后我执行了最后两个命令:

sudo apt-get updatesudo apt-get upgrade

在我删除错误包之前(libpciaccess一)使用 sudo dpkg -r libpciaccess* 或 sudo apt-get purge libpciaccess* ,但我认为恢复状态文件就足够了,因为当我更新和升级 Ubuntu 时安装了所有需要的升级,并且我的软件更新错误消失了。

我认为这个答案会帮助其他和我遇到同样问题的人。非常感谢你的帮助!

答案3

只是:

sudo apt-get remove package2remove --fix-broken

男人说:

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place.
       This option, when used with install/remove, can omit any packages
       to permit APT to deduce a likely solution

答案4

  • 前往/usr/share/doc/

  • 删除两个目录libpciaccess0libpciaccess-dev 目录

  • 这样做sudo apt install --fix-broken,问题就解决了。

相关内容