我有一个样例c++代码,它使用udev库接收热插拔事件。它在Ubuntu 10.04上运行得很好。唯一的先决条件是libudev-dev包: sudo apt-get install libudev-dev
但是当我在12.04中尝试安装这个包时,我得到了:
sudo apt-get install libudev-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:
libudev-dev : Depends: libudev0 (= 175-0ubuntu9) but 175-0ubuntu9.3 is to be installed
E: Unable to correct problems, you have held broken packages.这似乎意味着我应该安装libudev0,所以:
sudo apt-get install libudev0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libudev0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.我不确定如何从这里开始。libudev-dev依赖于libudev0,但它已经存在,所以...下一步是什么?
请注意,以下repos在sources.list中是取消注释的,我已经做了一个apt-get更新:
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb http://us.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe一些网站已经指出我应该做-f:
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.在这里找到了一个很好的链接:https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies,但没有joy。
谷歌表示,这对其他人来说是一次扣篮……
谢谢你在这方面的帮助,约翰
发布于 2013-06-21 08:28:12
这就是解决方案。
当您阅读以下内容时:
The following packages have unmet dependencies:
libudev-dev : Depends: libudev0 (= 175-0ubuntu9) but 175-0ubuntu9.3 is to be installed
E: Unable to correct problems, you have held broken packages.这意味着我尝试安装的libudev-dev包依赖于包:
libudev0 version 175-0ubuntu9(这就是"(= 175-0ubuntu9)“试图表达的意思)
但是已经安装了libudev0 175-0ubuntu9.3版。
(这就是“但175-0ubuntu9.3要安装”想说的意思)。
因此,换句话说:
您可以通过以下方式在/etc/apt/Soures.list中列出的所有存储库中找到可用的包:
sudo apt-cache madison libudev-dev
sudo apt-cache madison libudev0所以我们终于找到了真正的问题所在!我的sources.list存储库列表中缺少包含libudev-dev 175-0ubuntu9.3的存储库。
要修复它,请执行以下操作:
在http://packages.ubuntu.com上搜索"libudev-dev"
http://packages.ubuntu.com/precise-updates/libudev-dev
它显示了您想要了解的关于libudev-dev的所有内容。除了它没有显示我应该使用的repo url!所以我要做一点猜测…
sudo gedit /etc/apt/Sourcees.list添加这两个存储库deb http://us.archive.ubuntu.com/ubuntu/ precise更新主deb-src http://us.archive.ubuntu.com/ubuntu/精确-更新主
sudo apt-get update sudo apt-cache madison libudev-dev您应该会在输出libudev-dev | 175-0ubuntu9.3中看到libudev-dev 175-0ubuntu9.3 | http://us.archive.ubuntu.com/ubuntu/精确更新/main amd64 Packages
sudo apt-get install libudev-dev
这就像一个护身符!--
约翰
发布于 2015-01-24 03:26:58
不,不,不像一个护身符。
@ubuntu:~$ sudo apt-cache madison libudev-dev
libudev-dev | 175-0ubuntu9.8 | http://archive.ubuntu.com/ubuntu/精准更新/ amd64主包
libudev-dev | 175-0ubuntu9.8 | http://us.archive.ubuntu.com/ubuntu/精准更新/ amd64主包
ubuntu:~$ sudo apt-get install libudev-dev
帕克特听我说。费尔蒂格
Abhängigkeitsbaum wird aufgebaut
状态信息是……费尔蒂格
libudev-dev ist schon die neueste版本。
Probieren Sie»apt-get -f install«,um Sie zu korrigieren:
下图所示的是:
libudev-dev : Hängt ab von: libudev0 (= 175-0ubuntu9.8) aber175-0ubuntu9 soll installiert
libudev0 : Beschädigt: libudev0:i386 (!= 175-0ubuntu9)
libudev0:i386 : Beschädigt: libudev0 (!= 175-0ubuntu9.8) aber175-0ubuntu9 soll安装错误
E: Unerfüllte Abhängigkeiten。Versuchen»apt-get -f install«ohne Angabe eines Pakets (oder geben Sie eine Lösung an)。
这是做的
apt-get下载libudev0 libudev0:i386
sudo dpkg -i libudev0_*.deb
sudo apt-获取升级
发布于 2015-05-06 02:22:38
这是对我有效的方法:
https://stackoverflow.com/questions/17181073
复制相似问题