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
可以更加只能的判断所需包是否需要降级,不过不知道这么做有什么隐患,目前倒是能方便快捷地解决我的问题。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】