Ubuntu 2022.04版本安装libsdl2-dev出现pkgProblemResolver问题
Ubuntu 2022.04版本安装libsdl2-dev出现E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
1 | $ sudo apt-get install libsdl2-dev |
这个问题困扰了我大概两天,之前是安装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.
1 | sudo aptitude install myNewPackage |
If you don’t have aptitude on your machine yet, get it with
1 | sudo apt-get install aptitude |
使用aptitude
来替代apt-get
可以更加智能的判断所需包是否需要降级,不过不知道这么做有什么隐患,目前倒是能方便快捷地解决我的问题。
Ubuntu 2022.04版本安装libsdl2-dev出现pkgProblemResolver问题