从源代码编译软件:如何收集依赖列表?

从源代码编译软件:如何收集依赖列表?

我想从源代码编译 Nginx 1.9.8 并将其安装在 Ubuntu 14.04 服务器上。但是,对于任何软件来说,这都适用,如何确定需要在本地系统上安装哪些依赖项才能构建软件?

假设我想编译 Nginx。我总是可以aptitude show nginx通过存储库获取当前包的依赖项。另一方面,这可能不是正确的列表,因为存储库可能提供旧版本,其依赖项与我想要编译的新版本不同。

一般来说,如何收集需要在系统上安装给定软件的依赖项列表?

鉴于依赖项可能因我提供的编译选项而异,这是否是“反复试验”的问题。也就是说,我是否应该尝试编译,然后等待第一个错误,查看它抱怨什么,添加该依赖项,然后再次执行相同的迭代?

答案1

如果你足够幸运,在你的存储库中拥有该软件,你可以安装依赖项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.
Need to get 12.6 MB of archives.
After this operation, 54.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

相关内容