我安装了带有 Ubuntu 24.04 的新系统,其中我需要安装一个 ibm 数据库连接器(特别是ibm-iaccess-1.1.0.27-1.0,我有它的 .deb 安装文件)。此软件包需要旧版本的libodbc2、libodbccr2和libodbcinst2(也通过 .deb 软件包安装)。安装完所有这些软件包后,连接器就可以正常工作,但是如果我尝试运行apt upgrade
它,它会给出以下错误:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libodbc1 : Depends: libodbc2 (= 2.3.9-5ubuntu0.1) but 2.3.12-1ubuntu0.24.04.1 is installed
Depends: libodbccr2 (= 2.3.9-5ubuntu0.1) but 2.3.12-1ubuntu0.24.04.1 is installed
odbcinst1debian2 : Depends: libodbcinst2 (= 2.3.9-5ubuntu0.1) but 2.3.12-1ubuntu0.24.04.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
但如果我按照建议运行,apt --fix-broken install
它会删除我需要的软件包版本,并且连接器不再起作用。我该如何解决这个问题?
正如@guiverc 所建议的,该软件包具有与 Ubuntu 22.04 相关的依赖项,我通过插入与 24.04 相关的依赖项(libodbc2、odbcinst、libodbcinst2、libstdc++6)修改了依赖项。
我使用从依赖项中提取了文件
dpkg-deb -R
,然后DEBIAN/control
通过插入以下包来修改文件: 依赖:libodbc2、odbcinst、libodbcinst2、libstdc++6然后我通过重新编译文件
dpkg-deb -b
并最终安装具有更新依赖项的包。