无法安装包。有没有办法自动安装依赖项?

无法安装包。有没有办法自动安装依赖项?

我使用Ubuntu 14.04。我正在尝试安装dpkg-dev这需要一些依赖文件。

bin$ sudo apt-get install dpkg-dev
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:
 dpkg-dev : Depends: libdpkg-perl (= 1.17.5ubuntu5) but 1.17.5ubuntu5.6 is to be installed
            Recommends: build-essential but it is not going to be installed
            Recommends: fakeroot
            Recommends: libalgorithm-merge-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

之后,我正在执行以下操作,建议安装所有依赖项,之前的安装是必需的。

bin$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsdl-image1.2 libtar0 libva-x11-1 libxcb-composite0 libxcb-xv0
  vlc-plugin-notify vlc-plugin-pulse
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

这无法完成这项工作。请推荐一种克服这个障碍的方法。提前致谢。

答案1

  1. 更新包列表,看看是否修复了它。

  2. 使用其他工具(例如aptitude手动选择版本)并解决冲突。用户界面需要一些时间来适应,但它可以很好地挽救搞砸的依赖关系。

相关内容