由于依赖关系,ubuntu 12.04 libudev-dev 不会安装 [英] ubuntu 12.04 libudev-dev won't install because of dependencies

查看:39
本文介绍了由于依赖关系,ubuntu 12.04 libudev-dev 不会安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些使用 udev 库接收热插拔事件的示例 C++ 代码.它在 Ubuntu 10.04 中运行良好.唯一的先决条件是 libudev-dev 包:sudo apt-get install libudev-dev

但是当我尝试在 12.04 中安装该软件包时,我得到:

sudo apt-get install libudev-dev阅读包裹清单...完成构建依赖树读取状态信息...完成无法安装某些软件包.这可能意味着你有请求了一个不可能的情况,或者如果您使用的是不稳定的一些必需的包尚未创建的发行版或被移出 Incoming.以下信息可能有助于解决这种情况:以下软件包具有未满足的依赖项:libudev-dev : 取决于: libudev0 (= 175-0ubuntu9) 但要安装 175-0ubuntu9.3E:无法纠正问题,您持有破损的包裹.

这似乎暗示我应该安装 libudev0,所以:

sudo apt-get install libudev0阅读包裹清单...完成构建依赖树读取状态信息...完成libudev0 已经是最新版本了.0 升级,0 新安装,0 删除,0 未升级.

我不知道如何从这里开始.libudev-dev 依赖于 libudev0,但它已经到位,所以......接下来是什么?

请注意,sources.list 中未注释以下存储库,并且我已完成 apt-get 更新:

deb http://us.archive.ubuntu.com/ubuntu/精确主限制deb-src http://us.archive.ubuntu.com/ubuntu/精确主要受限deb http://us.archive.ubuntu.com/ubuntu/精确宇宙deb-src http://us.archive.ubuntu.com/ubuntu/精确宇宙

有些网站表明我应该做 -f:

sudo apt-get -f install阅读包裹清单...完成构建依赖树读取状态信息...完成0 升级,0 新安装,0 删除,0 未升级.

在这里找到了一个很好的链接:https://askubuntu.com/questions/140246/how-do-i-resolve-未满足的依赖但没有快乐.

谷歌说这是其他人的扣篮...

感谢您对此的任何帮助,约翰

解决方案

这是解决方案.

当您阅读以下内容时:

以下包有未满足的依赖项:libudev-dev : 取决于: libudev0 (= 175-0ubuntu9) 但要安装 175-0ubuntu9.3E:无法纠正问题,您持有破损的包裹.

这意味着我尝试安装的 libudev-dev 包依赖于包:

libudev0 版本 175-0ubuntu9

(这就是(= 175-0ubuntu9)"的意思)

但是已经安装了 libudev0 版本 175-0ubuntu9.3.

(这就是要安装 175-0ubuntu9.3"的意思.

换句话说:

  • 已安装较新版本的 libudev0.
  • 我尝试安装的 libudev-dev 软件包依赖于较旧版本的 libudev0,并且已安装.
  • 这反过来意味着我正在安装 libudev-dev 的存储库已过期.

您可以通过以下方式在您当前在/etc/apt/sources.list 中列出的所有存储库中找到可用的软件包:

sudo apt-cache madison libudev-dev须藤 apt-cache 麦迪逊 libudev0

所以我们终于解决了真正的问题!我在 sources.list 中的存储库列表缺少包含 libudev-dev 175-0ubuntu9.3 的存储库.

修复:

  1. 转到 http://packages.ubuntu.com 并搜索libudev-dev"

  2. 在结果列表中为 Precise Pangolin (ubuntu 12.04) 找到 175-0ubuntu9.3.在这种情况下,该版本位于精确更新"下.您可以点击链接:

    http://packages.ubuntu.com/precise-updates/libudev-dev

    它展示了你想知道的关于 libudev-dev 的一切.除了它没有显示我应该使用的确切 repo url!所以我要猜一下...

  3. 将存储库添加到 apt

    sudo gedit/etc/apt/sources.list[添加这两个仓库]deb http://us.archive.ubuntu.com/ubuntu/precision-updates maindeb-src http://us.archive.ubuntu.com/ubuntu/precision-updates main

  4. 刷新

    sudo apt-get 更新sudo apt-cache 麦迪逊 libudev-dev[您应该在输出中看到 libudev-dev 175-0ubuntu9.3]libudev-dev |175-0ubuntu9.3 |http://us.archive.ubuntu.com/ubuntu/precision-updates/main amd64 软件包

  5. 安装包:

    sudo apt-get install libudev-dev

    这就像一个魅力!

约翰

I have a some sample c++ code that receives hotplug events using the udev library. It worked fine in Ubuntu 10.04. It's only prerequisite was the libudev-dev package: sudo apt-get install libudev-dev

But when I tried to install that package in 12.04, I get:

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.

This seems to imply I should install libudev0, so:

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.

I'm not sure how to proceed from here. libudev-dev depends on libudev0 but that's already in place, so ... what's next?

Note that the following repos are un-commented in sources.list and I've done an apt-get update:

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

Some sites have indicated I should do -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.

Found an excellent link here: https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies but no joy.

Google says that this is a slam dunk for other folks out there...

Thanks for any help on this, John

解决方案

Here's the solution.

When you read the following:

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.

it means that the libudev-dev package I am trying to install depends on package:

libudev0 version 175-0ubuntu9

(That's what the "(= 175-0ubuntu9)" is trying to say)

But libudev0 version 175-0ubuntu9.3 has been already installed.

(That's what the "but 175-0ubuntu9.3 is to be installed" is trying to say).

So in other words:

  • a newer version of libudev0 is already installed.
  • the libudev-dev package I am trying to install depends on an older version of libudev0 older and it is already installed.
  • which in turn means that the repository I am installing libudev-dev from is out of date.

You can find the packages available in all of the repositories you currently have listed in /etc/apt/sources.list by:

sudo apt-cache madison libudev-dev
sudo apt-cache madison libudev0

So finally we get to the REAL problem! My list of repositories in sources.list is missing the one which contains libudev-dev 175-0ubuntu9.3.

To fix it:

  1. go to http://packages.ubuntu.com and search for "libudev-dev"

  2. In the resulting list find 175-0ubuntu9.3 for the Precise Pangolin (ubuntu 12.04). In this case that version is under "precise-udpates". You can click on the link:

    http://packages.ubuntu.com/precise-updates/libudev-dev

    which shows everything you wanted to know about libudev-dev. Except it doesn't show the exact repo url I should use! So I'm going to take a bit of a guess...

  3. add repos to apt

    sudo gedit /etc/apt/sources.list
    [ add these two repos ]
    deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main    
    deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main
    

  4. refresh

    sudo apt-get update
    sudo apt-cache madison libudev-dev
    [you should see libudev-dev 175-0ubuntu9.3 in the output]
    libudev-dev | 175-0ubuntu9.3 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
    

  5. install the package:

    sudo apt-get install libudev-dev
    

    which works like a charm!

John

这篇关于由于依赖关系,ubuntu 12.04 libudev-dev 不会安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆