我正在尝试安装依赖项来编译 Strongswan,因为主要软件包似乎已损坏。
当我尝试安装 libsoup 包时,出现以下错误:
~/strongswan-5.9.14# apt install -f libsoup2.4-dev
Reading package lists... Done
Building dependency tree... Done
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:
libbrotli-dev : Depends: libbrotli1 (= 1.1.0-2build2) but 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 is to be installed
这是在服务器安装上,最近升级到 24.04.1 LTS。
更新:包裹信息
# apt policy libbrotli1
libbrotli1:
Installed: 1.1.0-2+ubuntu22.04.1+deb.sury.org+1
Candidate: 1.1.0-2+ubuntu22.04.1+deb.sury.org+1
Version table:
*** 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 100
100 /var/lib/dpkg/status
1.1.0-2build2 500
500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
# apt-get remove libbrotli1
Reading package lists... Done
Building dependency tree... Done
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:
shim-signed : Depends: grub-efi-amd64-signed (>= 1.191~) but it is not going to be installed or
grub-efi-arm64-signed (>= 1.191~) but it is not installable or
base-files (< 12.3) but 13ubuntu10.1 is to be installed
Depends: grub-efi-amd64-signed (>= 1.187.2~) but it is not going to be installed or
grub-efi-arm64-signed (>= 1.187.2~) but it is not installable
Depends: grub2-common (>= 2.04-1ubuntu24) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
我看到安装的软件包来自 ppa,并且 repos 中有一个软件包。在不破坏所有内容的情况下,删除并重新安装 repo 软件包的最佳/安全方法是什么?
为了解决这个问题,我改变了 repo 的 pin 优先级:
在 /etc/apt/preferences.d 中我创建了一个文件 lib.pref
运行后
apt update
,apt policy libbrotli1
现在显示:然后我就可以重新安装该软件包。
然后我就可以毫无问题地安装依赖项。
我注释掉了 lib.pref 中的条目,以免搞乱将来的事情,但如果有另一个包需要从 22.04 ppa 升级,它就在那里。