方法 2 和 3

方法 2 和 3

由于以下未满足的依赖项,我无法安装 nmap

HP-Pavilion-g6-Notebook-PC:~$ sudo apt-get install nmap
[sudo] password for rohan: 
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:
nmap : Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.3 is to be   installed
E: Unable to correct problems, you have held broken packages.

我已经尝试过以下命令,但没有成功:

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get -f install

尝试搜索依赖项本身....

~$ apt-cache search libstdc | grep libstdc++6
libstdc++6 - GNU Standard C++ Library v3
libstdc++6-4.7-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-doc - GNU Standard C++ Library v3 (documentation files)
libstdc++6-4.8-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-arm64-cross - GNU Standard C++ Library v3
libstdc++6-armhf-cross - GNU Standard C++ Library v3
libstdc++6-powerpc-cross - GNU Standard C++ Library v3
libstdc++6-ppc64el-cross - GNU Standard C++ Library v3
libstdc++6-4.4-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.4-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.4-doc - GNU Standard C++ Library v3 (documentation files)
libstdc++6-4.4-pic - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.6-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.6-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.6-doc - GNU Standard C++ Library v3 (documentation files)
libstdc++6-4.6-pic - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.7-dbg-armel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dev-armel-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev-armhf-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-pic - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.7-pic-armel-cross - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.7-pic-armhf-cross - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.8-dbg-arm64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-powerpc-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-ppc64el-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-armel-cross - GNU Standard C++ Library v3
libstdc++6-4.9-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-arm64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-armel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-powerpc-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-ppc64el-cross - GNU Standard C++ Library v3 (debugging files)

并安装它....

~$ sudo apt-get install libstdc++6 -yReading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libstdc++6
0 upgraded, 0 newly installed, 0 to remove and 1629 not upgraded.

尝试安装 Aptitude 但是......

~$ sudo apt-get install aptitude
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:
 aptitude : Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.3 is to be installed
E: Unable to correct problems, you have held broken packages

帮助!!!

答案1

尝试安装依赖项。在 apt-get install 日志中,你会看到缺少依赖项:

libstdc++6

因此,为了修复此问题,请尝试搜索它以确保它可用:

apt-cache search libstdc | grep libstdc++6

或者

apt-cache show libstdc++6

从我的输出中我看到:

:~$ apt-cache search libstdc | grep libstdc++6
libstdc++6 - GNU Standard C++ Library v3
libstdc++6-5-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-arm64-cross - GNU Standard C++ Library v3
libstdc++6-armhf-cross - GNU Standard C++ Library v3
libstdc++6-powerpc-cross - GNU Standard C++ Library v3
libstdc++6-ppc64el-cross - GNU Standard C++ Library v3
libstdc++6-4.7-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dbg-armel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.7-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev-armel-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev-armhf-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-doc - GNU Standard C++ Library v3 (documentation files)
libstdc++6-4.7-pic - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.7-pic-armel-cross - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.7-pic-armhf-cross - GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.8-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-arm64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-powerpc-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.8-dbg-ppc64el-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-arm64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-armel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-powerpc-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-ppc64el-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.9-dbg-s390x-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-alpha-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-arm64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-armel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-armhf-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-hppa-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-m68k-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-mips-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-mips64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-mips64el-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-mipsel-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-powerpc-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-powerpcspe-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-ppc64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-ppc64el-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-s390x-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-sh4-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-5-dbg-sparc64-cross - GNU Standard C++ Library v3 (debugging files)
libstdc++6-alpha-cross - GNU Standard C++ Library v3
libstdc++6-armel-cross - GNU Standard C++ Library v3
libstdc++6-hppa-cross - GNU Standard C++ Library v3
libstdc++6-m68k-cross - GNU Standard C++ Library v3
libstdc++6-mips-cross - GNU Standard C++ Library v3
libstdc++6-mips64-cross - GNU Standard C++ Library v3
libstdc++6-mips64el-cross - GNU Standard C++ Library v3
libstdc++6-mipsel-cross - GNU Standard C++ Library v3
libstdc++6-powerpcspe-cross - GNU Standard C++ Library v3
libstdc++6-ppc64-cross - GNU Standard C++ Library v3
libstdc++6-s390x-cross - GNU Standard C++ Library v3
libstdc++6-sh4-cross - GNU Standard C++ Library v3
libstdc++6-sparc64-cross - GNU Standard C++ Library v3

所以... 对我来说第一个就够了。

sudo apt-get install libstdc++6 nmap -y

请注意,我还包含了 nmap,以便您在 libstdc++6 之后获得 nmap。

方法 2 和 3

就是尝试一个“不同的”包管理器,那就是 aptitude。

资质

将尝试安装或修复所有缺失的依赖项,您只需选择是否要遵循其指南即可。不幸的是,我没有用过太多,但每次我不得不使用它时,它总能解决我在使用 apt 时遇到的所有问题。

安装方法:

 sudo apt-get install aptitude -y

然后运行它:

 sudo aptitude install nmap

相关内容