我需要安装 的 32 位和 64 位版本musl-tools
,但每当我尝试安装其中一个版本时,另一个版本都会自动卸载。如果我同时尝试安装两个版本,就会发生冲突:
$ sudo apt-get install -y musl-tools gcc gcc-7 cpp binutils musl-tools:i386 gcc:i386 gcc-7:i386 cpp:i386 binutils:i386
The following packages have unmet dependencies:
binutils : Conflicts: binutils:i386 but 2.30-21ubuntu1~18.04.3 is to be installed
binutils:i386 : Conflicts: binutils but 2.30-21ubuntu1~18.04.3 is to be installed
cpp : Depends: cpp-7 (>= 7.4.0-1~) but it is not going to be installed
Conflicts: cpp:i386 but 4:7.4.0-1ubuntu2.3 is to be installed
cpp:i386 : Conflicts: cpp but 4:7.4.0-1ubuntu2.3 is to be installed
gcc : Conflicts: gcc:i386 but 4:7.4.0-1ubuntu2.3 is to be installed
gcc:i386 : Conflicts: gcc but 4:7.4.0-1ubuntu2.3 is to be installed
gcc-7 : Depends: cpp-7 (= 7.5.0-3ubuntu1~18.04) but it is not going to be installed
Conflicts: gcc-7:i386 but 7.5.0-3ubuntu1~18.04 is to be installed
gcc-7:i386 : Conflicts: gcc-7 but 7.5.0-3ubuntu1~18.04 is to be installed
musl-tools : Conflicts: musl-tools:i386 but 1.1.19-1 is to be installed
musl-tools:i386 : Conflicts: musl-tools but 1.1.19-1 is to be installed
E: Unable to correct problems, you have held broken packages.
这基本上就是我想做的事情:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib musl-tools
sudo mv /usr/bin/{,x86_64-linux-}musl-gcc
sudo mv /usr/bin/{,x86_64-linux-}musl-ldd
sudo apt-get install -y musl-tools:i386
sudo mv /usr/bin/{,i386-linux-}musl-gcc
sudo mv /usr/bin/{,i386-linux-}musl-ldd
答案1
这里也有同样的问题,这是我从其他地方重新发布的对该问题的最佳解释:
Debian Jessie 的 Multiarch 不允许并行安装可执行文件:
例如,包 python 包含安装到 /usr/bin 的可执行文件(例如 pdb、pydoc 等)。包 python:armhf 也包含这些可执行文件,它们也应该安装到 /usr/bin。
因此,不能同时安装 python 和 python:armhf,因为一个包的可执行文件会覆盖另一个包的可执行文件。
好消息是,您不需要两个 Python 解释器。对于您来说,我只需安装主机架构所需的 Python 解释器(例如 python:amd64)。请注意,使用 sudo apt-get build-dep -a armhf PACKAGE-NAME 等命令安装构建依赖项有时可能会失败,您必须猜测需要手动安装哪些软件包。