安装libudev-dev,解决依赖错误

http://*.com/questions/17181073/ubuntu-12-04-libudev-dev-wont-install-because-of-dependencies

//被依赖的libudev1是11.2版本
$ dpkg -l libudev1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================================-=========================-=========================-========================================================================================
ii libudev1:amd64 -0ubuntu11. amd64 libudev shared library
ii libudev1:i386 198-0ubuntu11. i386 libudev shared library //要安装libudev-dev这个包
zhangze@zhangze-OptiPlex-:/var/cache$ apt-cache search libudev-dev
libudev-dev - libudev development files
zhangze@zhangze-OptiPlex-:/var/cache$ dpkg -l libudev-dev
dpkg-query: no packages found matching libudev-dev //安装显示依赖不满足
zhangze@zhangze-OptiPlex-:/var/cache$ 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: libudev1 (= -0ubuntu11) but -0ubuntu11. is to be installed
E: Unable to correct problems, you have held broken packages.

安装libudev-dev,显示依赖于共享库libudev1,而版本(= -0ubuntu11)指的是当前要安装包libudev-dev的版本是11,但是应该安装的是11.2这个版本,

因此是要安装的libudev-dev所在仓库版本太老,而不是已安装的libudev1版本老。

去http://packages.ubuntu.com/搜索libudev-dev这个包,发现它是在security这部分中的,而系统的security开关被关闭,已经很久没有更新security的包了

因此在software & update中打开security update,再次apt-get install libudev-dev成功(也可以vim /etc/apt/sources.list添加security源)

安装完以后的最终结果是两个包全部更新到11.2版本,说明之前的问题是:libudev1已经在最新的11.2版本,

而要安装的libudev-dev在原来的仓库中是老版本11的,老版本不能依赖于新版本,添加security仓库,下载的是最新版本的libudev-dev包

zhangze@zhangze-OptiPlex-:/var/cache$ dpkg -l libudev-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================================-=========================-=========================-========================================================================================
ii libudev-dev -0ubuntu11. amd64 libudev development files
zhangze@zhangze-OptiPlex-:/var/cache$ dpkg -l libudev1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================================-=========================-=========================-========================================================================================
ii libudev1:amd64 -0ubuntu11. amd64 libudev shared library
ii libudev1:i386 -0ubuntu11. i386 libudev shared library
上一篇:Java GUI图形界面开发工具


下一篇:8 个优秀的 Linux 图形图像及色彩工具