os: ubuntu 22.04
APT source list:
occupymars2025@Lenovo:~$ cat /etc/apt/sources.list
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
occupymars2025@Lenovo:~$
occupymars2025@Lenovo:~$ 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:
libsdl2-dev : Depends: libdbus-1-dev but it is not going to be installed
Depends: libibus-1.0-dev but it is not going to be installed
Depends: libpulse-dev but it is not going to be installed
Depends: libsdl2-2.0-0 (= 2.0.20+dfsg-2build1) but 2.0.20+dfsg-2ubuntu1.22.04.1 is to be installed
Depends: libudev-dev but it is not going to be installed
Depends: libwayland-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Solution:
apt - E: Unable to correct problems, you have held broken packages - Ask Ubuntu
sudo aptitude install myNewPackage
aptitude is a high-level interface to the package manager and more intelligent than apt, it can provide several solutions to help you solve your problem. If you are not satisfied with one solution , you can say no, then switch to another solution.
occupymars2025@Lenovo:~$ sudo apt search libsdl2
[sudo] password for occupymars2025:
Sorting... Done
Full Text Search... Done
libsdl2-2.0-0/jammy,now 2.0.20+dfsg-2build1 amd64 [installed,automatic]
Simple DirectMedia Layer
libsdl2-dev/jammy,now 2.0.20+dfsg-2build1 amd64 [installed]
Simple DirectMedia Layer development files
libsdl2-doc/jammy,jammy 2.0.20+dfsg-2build1 all
Reference manual for libsdl2
libsdl2-gfx-1.0-0/jammy 1.0.4+dfsg-4 amd64
drawing and graphical effects extension for SDL2
libsdl2-gfx-dev/jammy 1.0.4+dfsg-4 amd64
development files for SDL2_gfx
libsdl2-gfx-doc/jammy,jammy 1.0.4+dfsg-4 all
documentation files for SDL2_gfx
libsdl2-image-2.0-0/jammy 2.0.5+dfsg1-3build1 amd64
Image loading library for Simple DirectMedia Layer 2, libraries
libsdl2-image-dev/jammy 2.0.5+dfsg1-3build1 amd64
Image loading library for Simple DirectMedia Layer 2, development files
libsdl2-mixer-2.0-0/jammy 2.0.4+dfsg1-4build1 amd64
Mixer library for Simple DirectMedia Layer 2, libraries
libsdl2-mixer-dev/jammy 2.0.4+dfsg1-4build1 amd64
Mixer library for Simple DirectMedia Layer 2, development files
libsdl2-net-2.0-0/jammy 2.0.1+dfsg1-7 amd64
Network library for Simple DirectMedia Layer 2, libraries
libsdl2-net-dev/jammy 2.0.1+dfsg1-7 amd64
Network library for Simple DirectMedia Layer 2, development files
libsdl2-ttf-2.0-0/jammy 2.0.18+dfsg-2 amd64
TrueType Font library for Simple DirectMedia Layer 2, libraries
libsdl2-ttf-dev/jammy 2.0.18+dfsg-2 amd64
TrueType Font library for Simple DirectMedia Layer 2, development files
occupymars2025@Lenovo:~$