首页 > 解决方案 > install boost armhf from apt

问题描述

I want to install libboost-dev-all:armhf in my cross compilation environment. I started like this

sudo debootstrap stretch crossdev_folder
sudo chroot crossdev_folder
dpkg --add-architecture armhf
apt-get update
apt-get install libboost-all-dev:armhf

then I got this

Reading package lists... Done
Building dependency tree       
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:
 libboost-all-dev:armhf : Depends: libboost-graph-parallel-dev:armhf but it is not going to be installed
                          Depends: libboost-mpi-dev:armhf but it is not going to be installed
                          Depends: libboost-mpi-python-dev:armhf but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then I installed libboost-graph-parallel-dev as suggested

apt-get install libboost-graph-parallel-dev:armhf

and it allowed me to continue with the installation of libboost-dev-all:armhf. However I got this error

/var/lib/dpkg/info/python2.7-minimal.postinst: 42: /var/lib/dpkg/info/python2.7-minimal.postinst: python2.7: Exec format error
dpkg: error processing package python2.7-minimal:armhf (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of python-minimal:armhf:
 python-minimal:armhf depends on python2.7-minimal (>= 2.7.13-1~); however:
  Package python2.7-minimal:armhf is not configured yet.

dpkg: error processing package python-minimal:armhf (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python2.7-minimal:armhf
 python-minimal:armhf
E: Sub-process /usr/bin/dpkg returned an error code (1)

So as I understand libboost-dev-all:armhf requires python2.7-minimal:armhf and python-minimal:armhf to work, so apt tries to install them together with boost libraries. However, during their installation, those broken packages are trying to execute some script situated at /var/lib/dpkg/info/python2.7-minimal.postinst, which is a shell script that in its 42 line does

if [ -n "$files" ]; then
    python2.7 -E -S /usr/lib/python2.7/py_compile.py $files
    ^^^^^^^^^
    if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
        python2.7 -E -S -O /usr/lib/python2.7/py_compile.py $files
    fi
else

trying to call python2.7 which is previously installed (also by boost) as armhf, removing the previous installation for amd. In consequence, as it is an armhf exec it cannot run in amd so it throws an Exec format error and everything fails.

Has somebody managed to install libboost-dev-all:armhf from apt?

标签: boostarmcross-compiling

解决方案


推荐阅读