apt-get install libicu-dev libicu-dev:i386 在 ubuntu18 上出现错误,但在 ubuntu16 上运行正常。有人有什么想法吗?有关详细信息,请参阅 PS,有关操作系统信息,请参阅 PP.S.
阿蒂姆。
附言
sudo apt-get install libicu-dev libicu-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
libicu-dev:i386 is already the newest version (60.2-3ubuntu3).
libicu-dev:i386 set to manually installed.
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:
libicu-dev : Conflicts: libicu-dev:i386 but 60.2-3ubuntu3 is to be installed
libicu-dev:i386 : Conflicts: libicu-dev but 60.2-3ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.
PP.S.
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
答案1
这是正常行为。
如果你比较从以下位置获得的两个软件包的文件列表https://packages.ubuntu.com/bionic/libicu-dev您将看到它们至少有一个相同的文件路径/usr/bin/icu-配置:
因此您不应该同时安装这两个包。
答案2
谢谢你的回答,我明白了。这种方法不允许在一台机器上同时构建 i386 和 amd64 c++ 应用程序。例如 centos7 和 redhat7 允许同时安装 i686 和 x86_64 软件包。据我了解,这种方法是设计用来同时安装这些软件包的。
答案3
这是一个在 Debian 中已修复的错误(2019-01-24),但尚未在 Ubuntu 中修复(2019-07-12): https://bugs.launchpad.net/ubuntu/+source/icu/+bug/1784135
因此,也无法使用 i386 ICU 依赖库,例如 libxml2。
当我尝试修复此类编译问题时,我发现了这个问题:
echo "int main(){return 0;}" > /tmp/a.cc && g++ /tmp/a.cc -lxml2 -o x64.bin && g++ /tmp/a.cc -m32 -lxml2 -o i386.bin
要在 x64 上编译它,我需要 libxml2-dev:i386,它包含 /usr/lib/i386-linux-gnu/libxml2.so,但我无法安装它,因为:
libxml2-dev:i386 : Depends: libicu-dev:i386 but it is not going to be installed
(libicu-dev:i386 与 libicu-dev 冲突)