如何安装 zlib1g-dev:armhf

如何安装 zlib1g-dev:armhf

我需要安装例如zlib1g-dev用于交叉开发。

$ sudo apt install zlib1g-dev:armhf
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:
 zlib1g-dev:armhf : Depends: zlib1g:armhf (= 1:1.2.11.dfsg-0ubuntu2) but it is not going to be installed
                    Depends: libc6-dev:armhf but it is not going to be installed or
                             libc-dev:armhf
E: Unable to correct problems, you have held broken packages.

我启用了臂丛对于 dpkg 并添加http://ports.ubuntu.com/ubuntu-portssources.list

$ apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ports.ubuntu.com/ubuntu-ports bionic/restricted armhf Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=armhf
     origin ports.ubuntu.com
 500 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=armhf
     origin ports.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=multiverse,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=universe,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=universe,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/restricted i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=restricted,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=restricted,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=amd64
     origin security.ubuntu.com
 500 http://archive.canonical.com/ubuntu bionic/partner armhf Packages
     release v=18.04,o=Canonical,a=bionic,n=bionic,l=Partner archive,c=partner,b=armhf
     origin archive.canonical.com
 500 http://archive.canonical.com/ubuntu bionic/partner i386 Packages
     release v=18.04,o=Canonical,a=bionic,n=bionic,l=Partner archive,c=partner,b=i386
     origin archive.canonical.com
 500 http://archive.canonical.com/ubuntu bionic/partner amd64 Packages
     release v=18.04,o=Canonical,a=bionic,n=bionic,l=Partner archive,c=partner,b=amd64
     origin archive.canonical.com
 100 http://de.archive.ubuntu.com/ubuntu bionic-backports/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 100 http://de.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=universe,b=amd64
     origin de.archive.ubuntu.com
 100 http://de.archive.ubuntu.com/ubuntu bionic-backports/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=main,b=i386
     origin de.archive.ubuntu.com
 100 http://de.archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=main,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=multiverse,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=multiverse,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=universe,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/restricted i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=restricted,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=restricted,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/multiverse i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=multiverse,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=multiverse,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/restricted i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=amd64
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/main i386 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=i386
     origin de.archive.ubuntu.com
 500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=amd64
     origin de.archive.ubuntu.com
Pinned packages:
$ apt-cache show 'zlib1g.*:armhf'
Package: zlib1g
Architecture: armhf
Version: 1:1.2.11.dfsg-0ubuntu2
Multi-Arch: same
Priority: required
Section: libs
Source: zlib
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Mark Brown <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 156
Provides: libz1
Depends: libc6 (>= 2.4)
Conflicts: zlib1 (<= 1:1.0.4-7)
Breaks: libxml2 (<< 2.7.6.dfsg-2), texlive-binaries (<< 2009-12)
Filename: pool/main/z/zlib/zlib1g_1.2.11.dfsg-0ubuntu2_armhf.deb
Size: 49596
MD5sum: 4df60b34250eeb828389d21b548c0124
SHA1: 93cc6a6b5d031b2e6e55865ecf4e8f1cacfdae0b
SHA256: a9272baf0cd13d8347312722ad123b33dd571528f4657e8002aba3f6ec1a4a11
Homepage: http://zlib.net/
Description-en: compression library - runtime
 zlib is a library implementing the deflate compression method found
 in gzip and PKZIP.  This package includes the shared library.
Description-md5: 567f396aeeb2b2b63295099aed237057
Task: minimal
Supported: 5y

Package: zlib1g-dev
Architecture: armhf
Version: 1:1.2.11.dfsg-0ubuntu2
Multi-Arch: same
Priority: optional
Section: libdevel
Source: zlib
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Mark Brown <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 412
Provides: libz-dev
Depends: zlib1g (= 1:1.2.11.dfsg-0ubuntu2), libc6-dev | libc-dev
Conflicts: zlib1-dev
Filename: pool/main/z/zlib/zlib1g-dev_1.2.11.dfsg-0ubuntu2_armhf.deb
Size: 168242
MD5sum: 4e1244dadec2f153b931442cbb78020e
SHA1: 9263a0c35f4d3fab833206ac8cc765ca5cc7fbd2
SHA256: 6314f78c76ba91de26af41e9352919346b7769955e2091e4c77864c7aa87c0cc
Homepage: http://zlib.net/
Description-en: compression library - development
 zlib is a library implementing the deflate compression method found
 in gzip and PKZIP.  This package includes the development support
 files.
Description-md5: d7f4e8a626131fc83c643c5d59096290
Task: lubuntu-gtk-desktop, lubuntu-desktop, lubuntu-qt-desktop
Supported: 5y

Package: zlib1g-dbg
Architecture: armhf
Version: 1:1.2.11.dfsg-0ubuntu2
Priority: extra
Section: libdevel
Source: zlib
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Mark Brown <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 140
Provides: libz-dbg
Depends: zlib1g (= 1:1.2.11.dfsg-0ubuntu2)
Filename: pool/main/z/zlib/zlib1g-dbg_1.2.11.dfsg-0ubuntu2_armhf.deb
Size: 85340
MD5sum: b9f6ab60990204dfdc8729075c824940
SHA1: 6a8f9577b3917d265664c5ceed3c90ad1fd6cfcd
SHA256: ba769ebaaf5c5e969b227e016eaf75c1b02971f54ed5f373e0ff6e74ffd5f2a6
Homepage: http://zlib.net/
Description-en: compression library - development
 zlib is a library implementing the deflate compression method found
 in gzip and PKZIP.  This package includes debugging symbols for use
 when debugging applications which use zlib.
Description-md5: dddc7d60663fa5dc77c76a30127d83db
Build-Ids: 581226ec1b03d29bf71c985908457c46a5d2d647
Supported: 5y

如果我正确解释 apt-cache,应该不会有问题!?不太确定如何安装 zlib1g-dev for armhf。有什么提示吗?

编辑


我追踪了依赖关系,看来问题可能出在ligcc1……

$ sudo apt install libgcc1:armhf 
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:
 libgcc1 : Breaks: libgcc1:armhf (!= 1:8.3.0-6ubuntu1~18.04.1) but 1:8-20180414-1ubuntu2 is to be installed
 libgcc1:armhf : Depends: gcc-8-base:armhf (= 8-20180414-1ubuntu2) but it is not going to be installed
                 Breaks: libgcc1 (!= 1:8-20180414-1ubuntu2) but 1:8.3.0-6ubuntu1~18.04.1 is to be installed

在我看来,无论是 bionic-update 是什么,都已经破坏了多架构的 libgcc1?

答案1

必须添加ppa:canonical-kernel-team/ppa才能获得臂丛版本同步的软件包amd64(仿生安全)。然后zlib1g-dev安装成功。

相关内容