从今天早上开始我已经能够解决未满足的依赖关系。
过去总是通过逐个安装软件包或安装 deb 包来解决这个问题,但在这种情况下我无法这样做。
我需要libvips-dev
在 Xubuntu 20.04 中安装:
sudo apt install libvips-dev
The following packages have unmet dependencies:
libvips-dev : Depends: libmagickcore-dev
Depends: libmagickwand-dev
Depends: librsvg2-dev (>= 2.40.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
还
sudo aptitude install libvips-dev
The following packages have unmet dependencies:
librsvg2-dev : Depends: librsvg2-2 (= 2.48.2-1) but 2.48.9-1ubuntu0.20.04.1 is installed
Depends: librsvg2-common (= 2.48.2-1) but 2.48.9-1ubuntu0.20.04.1 is installed
该文件/etc/apt/sources.list
是原始的,
在之前的搜索中我看到了很多解决方案并尝试过:
sudo apt --fix-broken install
sudo apt update --fix-missing
sudo apt dist-upgrade
sudo apt upgrade
sudo apt autoclean
sudo apt -f install
sudo dpkg --configure -a
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
。
sudo apt list --upgradable
Listing... Done
dpkg --get-selections | grep hold
give me nothing
我无法安装该库,然后尝试使用 apt 或 aptitude 安装它们的一些依赖项:
sudo apt install librsvg2-2=2.48.2-1
给我一个将要删除的软件包列表
然后使用 aptitude,同样的事情会发生:
sudo aptitude install librsvg2-2=2.48.2-1
我必须删除很多包裹。
Remove the following packages: 1 to 157
Install the following packages: 157 - 164
Leave the following dependencies unresolved: 161 to 187
如果我这样做,系统将不再运行。
也可以尝试:Synaptic->编辑->修复损坏的软件包
我做错了什么?
是否有其他包安装程序可以扫描存储库并递归安装所有需要的包?
我认为 apt 和 aptitude 必须独立完成这件事。
apt update 的输出是:
:sudo apt update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:2 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Hit:3 http://ci.archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [473 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1637 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [278 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [40.7 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1098 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [156 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [712 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [557 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [129 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [66.6 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2464 B]
Fetched 5321 kB in 19s (287 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
userone@pc:~
:apt list --upgradable
Listing... Done
linux-generic-hwe-20.04/focal-security 5.15.0.43.46~20.04.14 amd64 [upgradable from: 5.15.0.41.44~20.04.13]
linux-headers-generic-hwe-20.04/focal-security 5.15.0.43.46~20.04.14 amd64 [upgradable from: 5.15.0.41.44~20.04.13]
linux-image-generic-hwe-20.04/focal-security 5.15.0.43.46~20.04.14 amd64 [upgradable from: 5.15.0.41.44~20.04.13]
答案1
让我们通过检查以下版本来查看其中一个有问题的软件包:http://packages.ubuntu.com:
librsvg2-2
v2.48.2-1 位于focal
librsvg2-2
v2.48.9-1ubuntu0.20.04.1 位于focal-updates
啊哈。仔细看看你的资料来源。
根据您的apt update
输出,您已启用 Ubuntu 存储库focal
和口袋。focal-security
但你却错过了focal-updates
重新启用该口袋,运行另一个,sudo apt update
因为您的来源发生了变化,然后再次尝试安装。