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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ 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.

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问题

http://example.com/2023/03/19/2023-03-19-2133/

Author

HanyJie

Posted on

2023-03-19

Updated on

2023-03-20

Licensed under

Comments