如果您的软件包存在于系统仓库中,您可以使用包管理器来安装所需的依赖项。以Debian及其衍生发行版为例,可以使用apt命令来安装这些依赖项:
root # apt-get build-dep nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
注意,某些依赖项可能会被替换为其他版本,例如:
Note, selecting 'libgd-dev' instead of 'libgd2-dev'
Note, selecting 'liblua5.1-0-dev' instead of 'liblua5.1-dev'
接下来,系统将列出并安装所有新的依赖项包:
The following NEW packages will be installed:
autotools-dev debhelper dh-apparmor dh-systemd geoip-bin gettext
intltool-debian libcroco3 libfontconfig1-dev libfreetype6-dev libgd-dev
libgeoip-dev libice-dev libice6 libjbig-dev libjpeg-dev libjpeg-turbo8-dev
libjpeg8-dev liblua5.1-0 liblua5.1-0-dev liblzma-dev libmhash-dev libmhash2
libpam0g-dev libpcre3-dev libpcrecpp0 libperl-dev libpng12-dev
libpthread-stubs0-dev libreadline-dev libreadline6-dev libsm-dev libsm6
libtiff5-dev libtiffxx5 libtinfo-dev libunistring0 libvpx-dev libx11-dev
libxau-dev libxcb1-dev libxdmcp-dev libxml2-dev libxpm-dev libxslt1-dev
libxt-dev libxt6 pkg-config po-debconf x11-common x11proto-core-dev
x11proto-input-dev x11proto-kb-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 55 newly installed, 0 to remove and 0 not upgraded.
需要下载 12.6 MB 的归档文件。
此操作后,将额外占用 54.6 MB 的磁盘空间。
您是否希望继续? [Y/n]