Ubuntu 2022.04版本安装libsdl2-dev出现E: Error, pkgProblemResolver::Resolve generated breaks...

Ubuntu 2022.04版本安装libsdl2-dev出现E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

$ sudo apt-get install libsdl2-dev
Reading package lists... Done
Building dependency tree... Done
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:
 libegl-mesa0 : Depends: libgbm1 (= 22.0.5-0ubuntu0.1) but 22.0.5-0ubuntu0.2 is to be installed
 udev : Breaks: systemd (< 249.11-0ubuntu3.6)
        Breaks: systemd:i386 (< 249.11-0ubuntu3.6)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

​ 这个问题困扰了我大概两天,之前是安装build-essential包的时候也出现了类似的问题,重装了一遍系统,又换了apt源最后才成功的解决了。今天在安装libsdl2-dev这个包的时候又出现了同样的问题,注意看**libgbm1 (= 22.0.5-0ubuntu0.1) but 22.0.5-0ubuntu0.2 is to be installed**判断应该是依赖包的版本过新的问题,网上搜索了很多解决方法最后在Ubuntu社区找到了答案

Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflicting packages for you, but will make a series of recommendations asking you which of many possible suggested working scenarios you would like.

sudo aptitude install myNewPackage

If you don’t have aptitude on your machine yet, get it with

sudo apt-get install aptitude

​ 使用aptitude来替代apt-get可以更加智能的判断所需包是否需要降级,不过不知道这么做有什么隐患,目前倒是能方便快捷地解决我的问题。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值