无法满足 emacs24 的构建依赖关系 14.04

无法满足 emacs24 的构建依赖关系 14.04

我想手动安装emacs24.4我正在按照广泛使用的教程进行操作14.04但是当我想安装所需的构建依赖项时:

sudo apt-get build-dep emacs24
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have unmet dependencies:
 libgtk-3-dev : Depends: libwayland-dev (>= 1.2.0) but it is not going to be installed
E: Build-dependencies for emacs24 could not be satisfied.

我该如何解决这个问题,因为尝试手动安装依赖项会让我陷入对不同未满足的依赖项的无休止递归。

根据评论的要求:

apt-cache policy libwayland-dev
libwayland-dev:
  Installed: (none)
  Candidate: 1.4.0-1ubuntu1
  Version table:
     1.4.0-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

根据评论的要求:

sudo apt-mark showhold
$>

(空输出)

我进行了进一步的挖掘,发现 libwayland-dev 似乎依赖于太旧的版本:

The following packages have unmet dependencies:
 libwayland-dev : Depends: libwayland-client0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1~trusty1 is to be installed
                  Depends: libwayland-server0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1~trusty1 is to be installed
                  Depends: libwayland-cursor0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1~trusty1 is to be installed

当我尝试安装时(所有更新都已安装):

sudo apt-get install libwayland-client0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libwayland-client0 is already the newest version.

dpkg -s libwayland-client0
Package: libwayland-client0
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 95
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Multi-Arch: same
Source: wayland
Version: 1.7.0-0ubuntu1~trusty1

A降级依赖关系是别无选择因为我(当然)依赖于较新的库,但是如果可以同时安装两个库版本,并且这可以解决问题,我会认为这是一个可行的解决方案。

答案1

可以从 Trusty 升级到 Vivid。但是您使用的是 LTS 版本,因此还有另一种可能性:

按照下面的步骤更改依赖项,但我不能保证这样做没有副作用。另一方面,如果您不想降级其他软件包,您没有太多选择。

但这是仅有的一个开发库,因此您的系统不会受到任何影响。

通过强制安装

sudo dpkg -i --force-all libwayland-dev_1.4.0-1ubuntu1_amd64.deb

不是工作,在下一个之后sudo apt-get dist-upgrade,否则sudo apt-get upgrade你会遇到问题

You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libwayland-dev : Depends: libwayland-client0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1 is installed
                  Depends: libwayland-server0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1 is installed
                  Depends: libwayland-cursor0 (= 1.4.0-1ubuntu1) but 1.7.0-0ubuntu1 is installed
E: Unmet dependencies. Try using -f.

所以

  1. 下载 deb 文件libwayland-dev_1.4.0-1ubuntu1_amd64.deb

    cd; wget http://mirrors.kernel.org/ubuntu/pool/main/w/wayland/libwayland-dev_1.4.0-1ubuntu1_amd64.deb
    
  2. 更改依赖项

    mkdir deb$$
    cp libwayland-dev_1.4.0-1ubuntu1_amd64.deb deb$$
    cd deb$$
    dpkg-deb -x libwayland-dev_1.4.0-1ubuntu1_amd64.deb deb
    cd deb
    dpkg-deb -e ../libwayland-dev_1.4.0-1ubuntu1_amd64.deb
    perl -i -pe 's/= 1\.4\.0-1ubuntu1/>= 1.4.0-1ubuntu1/g' DEBIAN/control
    
  3. 重新创建 deb 文件

    cd ..
    sudo dpkg-deb -b deb
    
  4. 安装 deb 文件

    sudo dpkg -i deb.deb
    

这是我的 Vivid 上的安装

% apt-cache policy libwayland-client0
libwayland-client0:
  Installed: 1.7.0-0ubuntu1
  Candidate: 1.7.0-0ubuntu1
  Version table:
 *** 1.7.0-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
        100 /var/lib/dpkg/status
     1.7.0-0ubuntu1~vivid1 0
        500 http://ppa.launchpad.net/gnome3-team/gnome3-staging/ubuntu/ vivid/main amd64 Packages

% apt-cache policy libwayland-dev
libwayland-dev:
  Installed: 1.4.0-1ubuntu1
  Candidate: 1.7.0-0ubuntu1
  Version table:
     1.7.0-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
     1.7.0-0ubuntu1~vivid1 0
        500 http://ppa.launchpad.net/gnome3-team/gnome3-staging/ubuntu/ vivid/main amd64 Packages
 *** 1.4.0-1ubuntu1 0
        100 /var/lib/dpkg/status

相关内容