由于版本阻止依赖项,无法安装 libnotify-dev

由于版本阻止依赖项,无法安装 libnotify-dev

步骤1 ...

sudo apt-get -y update;
sudo apt-get -y upgrade;
sudo apt-get -y dist-upgrade;
sudo apt-get -y clean;
sudo apt-get -y autoremove;

... 结果是 ...

Hit:1 https://download.sublimetext.com apt/stable/ InRelease
Hit:2 http://linux.teamviewer.com/deb stable InRelease                                                                                                 
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease                                                                                             
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                           
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                      
Hit:7 http://mirror.clibre.uqam.ca/ubuntu bionic InRelease
Hit:8 http://mirror.clibre.uqam.ca/ubuntu bionic-updates InRelease
Hit:9 http://mirror.clibre.uqam.ca/ubuntu bionic-backports InRelease
Hit:10 http://mirror.clibre.uqam.ca/ubuntu bionic-security InRelease
Reading package lists... Done 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

第2步 ...

sudo apt install libnotify-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 resolve the situation:

The following packages have unmet dependencies:
 libnotify-dev : Depends: libglib2.0-dev (>= 2.26) but it is not going to be installed
                 Depends: libgdk-pixbuf2.0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

步骤#3 ...

sudo aptitude install libnotify-dev

... 结果是 ...

The following NEW packages will be installed:
  gcc-8-base:i386{ab} libblkid1:i386{ab} libc6:i386{a} libelf1:i386{a} libffi6:i386{a} libgcc1:i386{ab} libgdk-pixbuf2.0-dev{a} 
  libglib2.0-0:i386{ab} libglib2.0-bin:i386{ab} libglib2.0-dev{ab} libglib2.0-dev-bin{a} libmount1:i386{ab} libnotify-dev libpcre16-3{a} 
  libpcre3:i386{a} libpcre3-dev{a} libpcre32-3{a} libpcrecpp0v5{a} libpng-dev{a} libpng-tools{a} libpthread-stubs0-dev{a} libselinux1:i386{a} 
  libuuid1:i386{ab} libx11-dev{ab} libx11-doc{a} libxau-dev{a} libxcb1-dev{a} libxdmcp-dev{a} pkg-config{a} x11proto-core-dev{a} x11proto-dev{a} 
  xorg-sgml-doctools{a} xtrans-dev{a} zlib1g:i386{a} zlib1g-dev{a} 
0 packages upgraded, 35 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.6 MB of archives. After unpacking 48.7 MB will be used.
The following packages have unmet dependencies:
 libmount1 : Breaks: libmount1:i386 (!= 2.31.1-0.4ubuntu3.2) but 2.31.1-0.4ubuntu3.1 is to be installed
 libmount1:i386 : Breaks: libmount1 (!= 2.31.1-0.4ubuntu3.1) but 2.31.1-0.4ubuntu3.2 is installed
 gcc-8-base : Breaks: gcc-8-base:i386 (!= 8.2.0-1ubuntu2~18.04) but 8-20180414-1ubuntu2 is to be installed
 gcc-8-base:i386 : Breaks: gcc-8-base (!= 8-20180414-1ubuntu2) but 8.2.0-1ubuntu2~18.04 is installed
 libgcc1 : Breaks: libgcc1:i386 (!= 1:8.2.0-1ubuntu2~18.04) but 1:8-20180414-1ubuntu2 is to be installed
 libgcc1:i386 : Breaks: libgcc1 (!= 1:8-20180414-1ubuntu2) but 1:8.2.0-1ubuntu2~18.04 is installed
 libblkid1 : Breaks: libblkid1:i386 (!= 2.31.1-0.4ubuntu3.2) but 2.31.1-0.4ubuntu3.1 is to be installed
 libblkid1:i386 : Breaks: libblkid1 (!= 2.31.1-0.4ubuntu3.1) but 2.31.1-0.4ubuntu3.2 is installed
 libuuid1 : Breaks: libuuid1:i386 (!= 2.31.1-0.4ubuntu3.2) but 2.31.1-0.4ubuntu3.1 is to be installed
 libuuid1:i386 : Breaks: libuuid1 (!= 2.31.1-0.4ubuntu3.1) but 2.31.1-0.4ubuntu3.2 is installed
 libglib2.0-bin : Conflicts: libglib2.0-bin:i386 but 2.56.1-2ubuntu1 is to be installed
 libglib2.0-bin:i386 : Conflicts: libglib2.0-bin but 2.56.3-0ubuntu0.18.04.1 is installed
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.56.3-0ubuntu0.18.04.1 is installed
 libx11-dev : Depends: libx11-6 (= 2:1.6.4-3) but 2:1.6.4-3ubuntu0.1 is installed
 libglib2.0-0 : Breaks: libglib2.0-0:i386 (!= 2.56.3-0ubuntu0.18.04.1) but 2.56.1-2ubuntu1 is to be installed
 libglib2.0-0:i386 : Breaks: libglib2.0-0 (!= 2.56.1-2ubuntu1) but 2.56.3-0ubuntu0.18.04.1 is installed
open: 44; closed: 1251; defer: 26; conflict: 34                                                                                                        

The following actions will resolve these dependencies:

      Keep the following packages at their current version:
1)      gcc-8-base:i386 [Not Installed]                    
2)      libblkid1:i386 [Not Installed]                     
3)      libc6:i386 [Not Installed]                         
4)      libelf1:i386 [Not Installed]                       
5)      libffi6:i386 [Not Installed]                       
6)      libgcc1:i386 [Not Installed]                       
7)      libgdk-pixbuf2.0-dev [Not Installed]               
8)      libglib2.0-0:i386 [Not Installed]                  
9)      libglib2.0-bin:i386 [Not Installed]                
10)     libglib2.0-dev [Not Installed]                     
11)     libmount1:i386 [Not Installed]                     
12)     libnotify-dev [Not Installed]                      
13)     libpcre3:i386 [Not Installed]                      
14)     libselinux1:i386 [Not Installed]                   
15)     libuuid1:i386 [Not Installed]                      
16)     libx11-dev [Not Installed]                         
17)     zlib1g:i386 [Not Installed]                        



Accept this solution? [Y/n/q/?] y

... 但接受只会让我...

No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

版本:

lsb_release -a

... 显示 ...

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic

我该如何解决这个问题并安装该包?

更新时间 2019-03-28 18:05 EST

也試過了...

sudo apt install libglib2.0-dev libgdk-pixbuf2.0-dev

... 得到 ...

 libgdk-pixbuf2.0-dev : Depends: libx11-dev but it is not going to be installed
 libglib2.0-dev :       Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.56.3-0ubuntu0.18.04.1 is to be installed
                        Depends: libglib2.0-bin (= 2.56.1-2ubuntu1)

更新时间 2019-03-29 06:45 EST

根据@fkraiem 的问题:

apt-cache policy libglib2.0-dev

... 生产 ...

libglib2.0-dev:
  Installed: (none)
  Candidate: 2.56.1-2ubuntu1
  Version table:
     2.56.1-2ubuntu1 500
        500 http://mirror.clibre.uqam.ca/ubuntu bionic/main amd64 Packages

根据@Mamayogi 表达的担忧:

dpkg --print-architecture; dpkg --print-foreign-architectures;

... 生产 ...

amd64
i386

...但是,尽管如此,该命令仍然sudo apt install libnotify-dev给出与最初相同的“未满足的依赖关系”结果。

答案1

依赖项不可用的一个可能原因是存档镜像过期,尤其是当所需软件包是官方软件包时,就像这里的情况一样。您可以查看所有可用存档镜像的列表及其更新状态这里;如果您的镜像已过期,请尝试另一个。

相关内容