我有一些使用 udev 库接收热插拔事件的示例 C++ 代码。它在 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,但它已经到位,所以......下一步是什么?
请注意,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 但不高兴。
谷歌说这对其他人来说是一个灌篮......
感谢您对此的任何帮助,约翰