安装包的依赖关系如此之多'nmap'

So much dependencies for installing the package 'nmap'

我想通过命令 apt-get 在 debian 上安装包 nmap,但是似乎包 nmap 依赖于这么多依赖项!例如它依赖于包 imagemagickx11-common!除非 nmap 需要 X window 系统!?一切都好吗?

# apt-get install nmap

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  dbus fontconfig fonts-droid fonts-liberation ghostscript gnuplot gnuplot-nox groff gsfonts hicolor-icon-theme imagemagick imagemagick-common libavahi-client3
  libavahi-common-data libavahi-common3 libblas3 libblas3gf libcairo2 libcroco3 libcups2 libcupsimage2 libdatrie1 libdbus-1-3 libdjvulibre-text libdjvulibre21 libexiv2-12
  libffi5 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgfortran3 libglib2.0-0 libglib2.0-data libgs9 libgs9-common libice6 libijs-0.35 libilmbase6 libjasper1 libjbig0
  libjbig2dec0 liblcms1 liblcms2-2 liblensfun-data liblensfun0 liblinear-tools liblinear1 liblqr-1-0 liblua5.1-0 libmagickcore5 libmagickcore5-extra libmagickwand5
  libnetpbm10 libopenexr6 libpango1.0-0 libpaper-utils libpaper1 libpcap0.8 libpixman-1-0 librsvg2-2 librsvg2-common libsm6 libsvm-tools libsystemd-login0 libthai-data
  libthai0 libtiff4 libwmf0.2-7 libxaw7 libxcb-render0 libxcb-shm0 libxft2 libxmu6 libxrender1 libxt6 netpbm poppler-data psutils shared-mime-info ufraw-batch x11-common

这是 Debian 7 wheezy (oldstable) which was fixed in Debian 8 jessie (stable). Nmap requires the liblinear1 package in order to do IPv6 OS detection, and that package had a "recommends" dependency on liblinear-tools, which further recommended libsvm-tools, which requires gnuplot, and that is where the X11 dependencies are coming from. In Debian jessie and later releases, liblinear1 上的一个问题,已将对 liblinear-tools 的依赖性降级为 "suggests",因此这不是问题。

要解决您的特定问题,您可以升级到更新的 Debian 版本,或使用 apt-get --no-install-recommends install nmap。不过,更好的解决方案是使用从源代码构建或从官方 RPM 安装的最新版本的 Nmap。您可以使用 alien to install RPMs on a Debian system. The version of Nmap that Debian wheezy installs (6.00) is over 3 years old and has several known bugs. Debian jessie is on the (current) latest stable version, 6.47, but that is also a year old and about to be eclipsed. The latest version can always be downloaded from https://nmap.org/download.html