为什么“apt build-dep”没有安装我需要的软件包?

为什么“apt build-dep”没有安装我需要的软件包?

我正在尝试从源代码构建linux-raspi软件包。

我运行了apt build-dep -y linux-raspi它,安装了许多依赖项。如果我再次运行它,则表明所有必需的软件包都已安装。

然后我运行dpkg-buildpackage,但出现错误:

dpkg-checkbuilddeps: error: Unmet build dependencies: dh-systemd cpio kernel-wedge kmod
libcap-dev libelf-dev libnewt-dev libiberty-dev rsync libdw-dev libpci-dev pkg-config flex
bison libunwind8-dev openssl libssl-dev libaudit-dev bc libudev-dev uuid-dev dkms curl xmlto
docbook-utils ghostscript fig2dev sharutils asciidoc python3-sphinx python3-sphinx-rtd-theme
python3-docutils

清楚地apt-cache showsrc linux-raspi表明cpio(例如)是一种构建依赖项:

Package: linux-raspi
...
Build-Depends: debhelper (>= 9), dh-systemd, cpio, kernel-wedge, kmod 
<!stage1>, makedumpfile [amd64] <!stage1>, libelf-dev <!stage1>, libnewt-dev 
<!stage1>, libiberty-dev <!stage1>, rsync <!stage1>, libdw-dev <!stage1>, 
libpci-dev <!stage1>, pkg-config <!stage1>, flex <!stage1>, bison <!stage1>, 
libunwind8-dev [amd64 arm64 armhf ppc64el] <!stage1>, openssl <!stage1>, 
libssl-dev <!stage1>, libaudit-dev <!stage1>, bc <!stage1>, gawk <!stage1>, 
device-tree-compiler [powerpc] <!stage1>, u-boot-tools [powerpc] <!stage1>, 
libc6-dev-ppc64 [powerpc] <!stage1>, libudev-dev <!stage1>, autoconf <!stage1>, 
automake <!stage1>, libtool <!stage1>, uuid-dev <!stage1>

那么,为什么没有安装它呢?它为什么对需要哪些软件包apt build-dep存在分歧?dpkg-buildpackage

答案1

man apt-get

build-dep
   [snip]

   The arguments are interpreted as binary or source package names. See the --only-source
   option if you want to change that.

linux-raspi源包提供了这些二进制包(在 Ubuntu 22.04 Docker 容器上):

Binary: linux-raspi-headers-5.15.0-1005, linux-raspi-tools-5.15.0-1005, linux-image-5.15.0-1005-raspi, linux-modules-5.15.0-1005-raspi, linux-modules-extra-5.15.0-1005-raspi, linux-headers-5.15.0-1005-raspi, linux-image-5.15.0-1005-raspi-dbgsym, linux-tools-5.15.0-1005-raspi, linux-buildinfo-5.15.0-1005-raspi, linux-image-5.15.0-1005-raspi-nolpae, linux-modules-5.15.0-1005-raspi-nolpae, linux-modules-extra-5.15.0-1005-raspi-nolpae, linux-headers-5.15.0-1005-raspi-nolpae, linux-image-5.15.0-1005-raspi-nolpae-dbgsym, linux-tools-5.15.0-1005-raspi-nolpae, linux-buildinfo-5.15.0-1005-raspi-nolpae

linux-raspi二进制包由该包提供linux-meta-raspi

看起来您想要构建linux-raspi源包,因此:

# apt-get build-dep linux-raspi --only-source
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  asciidoc asciidoc-base asciidoc-common autoconf automake autopoint autotools-dev bc binutils binutils-aarch64-linux-gnu binutils-common bison bsdextrautils
  build-essential bzip2 ca-certificates ca-certificates-java cpio cpp cpp-11 cpp-12 curl dctrl-tools debhelper debugedit default-jdk-headless default-jre-headless
  dh-autoreconf dh-strip-nondeterminism distro-info-data dkms docbook-dsssl docbook-utils docbook-xml docbook-xsl docutils-common dpkg-dev dvipng dwz fig2dev file
  flex fontconfig fontconfig-config fonts-dejavu-core fonts-font-awesome fonts-lato fonts-lmodern fonts-noto-cjk fonts-urw-base35 g++ g++-11 gawk gcc gcc-11
  gcc-11-base gcc-12 gettext gettext-base ghostscript graphviz groff-base hicolor-icon-theme imagemagick imagemagick-6-common imagemagick-6.q16 intltool-debian
  java-common kmod latexmk libann0 libaom3 libapache-pom-java libarchive-zip-perl libasan6 libasan8 libasound2 libasound2-data libatomic1 libaudit-dev
  libavahi-client3 libavahi-common-data libavahi-common3 libbinutils libbpf0 libbrotli1 libbsd0 libc-dev-bin libc6-dev libcairo-gobject2 libcairo2 libcap-dev
  libcap-ng-dev libcc1-0 libcdt5 libcgraph6 libcommons-logging-java libcommons-parent-java libcrypt-dev libctf-nobfd0 libctf0 libcups2 libcurl4 libdatrie1 libdav1d5
  libdbus-1-3 libde265-0 libdebhelper-perl libdeflate0 libdpkg-perl libdw-dev libdw1 libelf-dev libelf1 libexpat1 libexpat1-dev libfftw3-double3
  libfile-stripnondeterminism-perl libfontbox-java libfontconfig1 libfreetype6 libfribidi0 libgcc-11-dev libgcc-12-dev libgd3 libgdbm-compat4 libgdbm6
  libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-common libglib2.0-0 libgomp1 libgraphite2-3 libgs9 libgs9-common libgts-0.7-5 libgvc6 libgvpr2 libharfbuzz0b libheif1
  libhwasan0 libiberty-dev libice6 libicu70 libidn12 libijs-0.35 libisl23 libitm1 libjbig0 libjbig2dec0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-sphinxdoc
  libjs-underscore libkmod2 libkpathsea6 liblab-gamut1 liblcms2-2 libldap-2.5-0 liblqr-1-0 liblsan0 libltdl7 liblzma-dev libmagic-mgc libmagic1
  libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmd0 libmpc3 libmpdec3 libmpfr6 libnetpbm10 libnewt-dev libnewt0.52 libnghttp2-14 libnsl-dev libnspr4 libnss3
  libnuma-dev libnuma1 libopenjp2-7 libosp5 libostyle1c2 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpathplan4 libpci-dev
  libpci3 libpcsclite1 libpdfbox-java libperl5.34 libpipeline1 libpixman-1-0 libpng-dev libpng16-16 libpopt0 libpsl5 libptexenc1 libpython3-dev libpython3-stdlib
  libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib libreadline8 librsvg2-2 librsvg2-bin librtmp1 libsasl2-2 libsasl2-modules-db
  libsgmls-perl libsigsegv2 libslang2 libslang2-dev libsm6 libsqlite3-0 libssh-4 libssl-dev libstdc++-11-dev libsub-override-perl libsynctex2 libteckit0 libtexlua53
  libthai-data libthai0 libtiff5 libtirpc-dev libtool libtsan0 libtsan2 libubsan1 libuchardet0 libudev-dev libunwind-dev libunwind8 libwebp7 libwebpdemux2
  libwebpmux3 libx11-6 libx11-data libx265-199 libxau6 libxaw7 libxcb-render0 libxcb-shm0 libxcb1 libxdmcp6 libxext6 libxi6 libxml2 libxml2-utils libxmu6 libxpm4
  libxrender1 libxslt1.1 libxt6 libzzip-0-13 linux-libc-dev lsb-release lto-disabled-list lynx lynx-common m4 make man-db media-types netpbm openjade
  openjdk-11-jdk-headless openjdk-11-jre-headless opensp openssl pahole patch pci.ids perl perl-modules-5.34 pkg-config po-debconf poppler-data preview-latex-style
  python-babel-localedata python3 python3-alabaster python3-babel python3-certifi python3-chardet python3-dev python3-distutils python3-docutils python3-idna
  python3-imagesize python3-jinja2 python3-lib2to3 python3-markupsafe python3-minimal python3-packaging python3-pkg-resources python3-pygments python3-pyparsing
  python3-requests python3-roman python3-six python3-snowballstemmer python3-sphinx python3-sphinx-rtd-theme python3-tz python3-urllib3 python3.10 python3.10-dev
  python3.10-minimal readline-common rpcsvc-proto rsync sgml-base sgml-data sgmlspl shared-mime-info sharutils sphinx-common sphinx-rtd-theme-common t1utils teckit
  tex-common texlive-base texlive-binaries texlive-fonts-recommended texlive-formats-extra texlive-latex-base texlive-latex-extra texlive-latex-recommended
  texlive-pictures texlive-plain-generic texlive-xetex tipa tzdata ucf uuid-dev x11-common xdg-utils xml-core xmlto xsltproc xz-utils zlib1g-dev
The following packages will be upgraded:
  libcap2
1 upgraded, 348 newly installed, 0 to remove and 0 not upgraded.

若没有该选项,它只会尝试安装 90 个新包。

相关内容