linuxgurugamer / ksp-advanced-flybywire

Controller mod for Kerbal Space Program
MIT License
26 stars 11 forks source link

DllNotFoundException on Ubunut-based Linux #36

Open StarkRG opened 3 years ago

StarkRG commented 3 years ago

As mentioned in the forum thread, the most recent couple of releases (1.8.3.5 and 1.8.3.6) throw DllNotFoundExceptions for libSDL2-2.14, older versions still work.

I think I've tracked the problem down to line 43 of AFBW/SDL2.cs which currently reads: private const string nativeLibName = "libSDL2-2.14"; but used to read: private const string nativeLibName = "libSDL2-2.0.so.0";

Given that the actual file name that exists on the system is "libSDL2-2.0.so.0" I'm guessing that is the correct value (particularly given that the old versions still function), but I suppose it equally might be "libSDL2-2.0.14" which is the version of SDL2 installed and, until yesterday, the currently stable release.

linuxgurugamer commented 3 years ago

The problem is that it depends on which version of Linux you are using. I can't support them all, you can try making a symlink from your current libsdl2 to the name in the file

StarkRG commented 3 years ago

"libSDL2-2.14" seems like such an unusual filename. Would pointing it to "libSDL2.so", which is simlinked on ubuntu-based distros, be more universal?

grossws commented 2 years ago

Usually ldconfig generates right symlinks, so you should be able to use just libSDL2 (or libSDL2-2.0 if you strictly require 2.0 instead of 2.x). /usr/lib (or /usr/lib/x86_64-linux-gnu in case of Ubuntu) usually contains something like libSDL2.so -> libSDL2-2.0.so -> libSDL2-2.0.so.0 -> libSDL2-2.0.s.0.18.0 symlink chain (depending on your SDL2 ABI version, 0.18.0 in my case on Arch, 0.10.0 on Ubuntu 20.04).

pogojotz commented 1 year ago

Same issue on Arch Linux. I second the suggestion of others to use libSDL2-2.0.so or libSDL2.so instead of libSDL2-2.14.

fmatosqg commented 1 year ago

Agree with @grossws and @pogojotz in theory.

I'm on Linux Mint 21 (derived from Ubuntu 22.04?) and these are the files I originally had available ( I think, because I created so many links):

> ls -l libSDL2*
-rw-r--r-- 1 root 1676536 May 31  2022 libSDL2-2.0.so.0.18.2
lrwxrwxrwx 1 root      21 Jan 30 20:31 libSDL2-2.so.0 -> libSDL2-2.0.so.0.18.2

if I try to see what originally apt installed for me, I get these

> apt-file find libSDL2-2
libsdl2-2.0-0: /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
libsdl2-2.0-0: /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.18.2
libsdl2-dev: /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so

which if I understand, would make it work with libSDL2-2.0.so if the install instructions are sudo apt-get install libsdl2-dev but not with apt-get install libsdl2. But that will be a meaningful improvement anyways.

Either way, libSDL2-2.14 is too specific, relaxing to 2-2 will always be better

workaround

now that I created a number of symlinks it worked, I believe the needed one was either libSDL2-2.14.so.0 or libSDL2-2.14.so.

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libSDL2-2.0.so.0.18.2 libSDL2-2.14.so.0
sudo ln -s libSDL2-2.0.so.0.18.2 libSDL2-2.14.so
trinitronx commented 3 months ago

Same issue on Manjaro Linux (based on Arch).

Stock sdl2 package installed libSDL2 files:

$ pacman -Ql sdl2 | grep -i libSDL2
sdl2 /usr/lib/libSDL2-2.0.so
sdl2 /usr/lib/libSDL2-2.0.so.0
sdl2 /usr/lib/libSDL2-2.0.so.0.3000.3
sdl2 /usr/lib/libSDL2.so
sdl2 /usr/lib/libSDL2_test.a
sdl2 /usr/lib/libSDL2main.a

Stock Distro Installed symlinks:

$ ls -lA /usr/lib/libSDL2-2.0.so*
lrwxrwxrwx 1 root root      16 May  2 14:04 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0
lrwxrwxrwx 1 root root      23 May  2 14:04 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.3
-rwxr-xr-x 1 root root 1864168 May  2 14:04 /usr/lib/libSDL2-2.0.so.0.3000.3

@linuxgurugamer: I'd tend to agree with @fmatosqg 's suggestion to relax the version to libSDL2-2.0.so, as it seems to be the common denominator symlink name across distros.

trinitronx commented 3 months ago

Looking further into this, I can see what is going on. There was a "method to the madness" so to speak:

  1. In 799b549, support for loading the library by filename was added for all operating systems (Linux, Mac, Windows)
  2. In 6b0942c, support for an updated SDL2 library was added for KSP 1.12. This change included extensive C# wrapper code for SDL2, but only for Windows (presumably SDL 2.0.14 or greater is needed from the looks of that code).
  3. In 96052fe, that C# wrapper was removed, and SDL2 library names via versioned libSDL2-2.14 for Linux, and libSDL2-2.0.14 for MacOS. Windows kept simply SDL2.

So, it appears that KSP and this mod have a dependency on SDL2 >= 2.0.14. Normally such version constraints would be handled by the package manager, not compiled into the application code... but this is a cross-platform game mod written in C#, and most users are probably not savvy enough to grok the compatibility rationale behind software version constraints.

Unfortunately the hardcoded library name will break for anything not exactly equal to libSDL2-2.0.14, which will fail to work on any modern *nix system with latest libSDL2 or anything else that doesn't exactly match that name. Thus, the workaround hack most people have found is to simply create a symlink named libSDL2-2.0.14 that links to the proper libSDL2 library .so file on their system. Not quite ideal.

Ideally, we could avoid using hardcoded library names in the code and just link to whatever is on the system in the hopes that it's >= 2.0.14 and then specify that version constraint elsewhere. In other words: rely on packaging & package managers to do the right thing. I'm aware that there is ckan for KSP mods but I'm not sure about whether it supports version constraints on system-level libraries? :shrug:

I was going to simply make a PR that reverted the filenames to the generic libSDL2-2.0.so.0 & libSDL2-2.0.0.dylib for Linux & OSX respectively. However, now after digging further into it, it looks like there was a need for discussing the version constraint concern first. :shrug:

P.S.: FWIW, I've applied the symlink workaround on my system and done some testing using a Saitek x52 H.O.T.A.S. (non-pro version). Everything seems to work fine, and my system has libSDL2-2.0.so.0.3000.3 (sdl2 package from Arch extra repo: 2.30.3-1).

maxtimbo commented 2 weeks ago

So I'm new to this mod after having reinstalled KSP after some years away. I got this mod last night (20240826) and there was an update to 1.8.4.2 this morning (20240827). According to the forum:

New release, 1.8.4.2

  • Thanks to github user @archiecarrot123 for this:
    • On Linux, changes the libSDL2 version to a generic version (fixes compatibility with different versions of libSDL2)
  • Updated KSP versions in the version file, and URL for mod reference

Unfortunately, this fix has not worked for me. Here are some specs:

From KSP.log


OS: Linux 6.9 Pop!_OS 22.04 64bit
CPU: AMD FX(tm)-8320 Eight-Core Processor (8)
RAM: 32040
GPU: AMD Radeon RX 6600 (radeonsi, navi23, LLVM 17.0.6, DRM 3.57, 6.9.3-76060903-generic) (6853MB)
SM: 50 (OpenGL 4.6 (Core Profile) Mesa 24.1.0-devel)
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BGRA32, RGB111110Float, RG32, RGBAUShort, RG16, BGRA10101010_XR, BGR101010_XR, R16

[. . .]

[EXC 09:01:40.694] DllNotFoundException: libSDL2
        KSPAdvancedFlyByWire.SDLController.InitializeSDL () (at <b8bf08e35ace48fa93055849ba2b7b5e>:0)
        KSPAdvancedFlyByWire.SDLController.SDLUpdateState () (at <b8bf08e35ace48fa93055849ba2b7b5e>:0)
        KSPAdvancedFlyByWire.AdvancedFlyByWire.Update () (at <b8bf08e35ace48fa93055849ba2b7b5e>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
$ sudo nala search libsdl2
libsdl2-2.0-0 2.0.20+dfsg-2ubuntu1.22.04.1 [Ubuntu/jammy main]
├── is installed
└── Simple DirectMedia Layer

libsdl2-dev 2.0.20+dfsg-2ubuntu1.22.04.1 [Ubuntu/jammy universe]
└── Simple DirectMedia Layer development files
$ lah /usr/lib/x86_64-linux-gnu/ | grep -i libsdl2
lrwxrwxrwx   1 root root    21 May 30  2022 libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.18.2
-rw-r--r--   1 root root  1.6M May 30  2022 libSDL2-2.0.so.0.18.2

If there are anymore pieces of information needed, I'd be glad to help. Interesting that I just so happened to hop on as this bug is being addressed. Kudos!

trinitronx commented 2 weeks ago

@maxtimbo: Unfortunately, this fix has not worked for me. Here are some specs:

[...SNIP...]

$ lah /usr/lib/x86_64-linux-gnu/ | grep -i libsdl2
lrwxrwxrwx   1 root root    21 May 30  2022 libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.18.2
-rw-r--r--   1 root root  1.6M May 30  2022 libSDL2-2.0.so.0.18.2

So, it looks like both Debian & Ubuntu ship without a libSDL2.so symlink. For comparison, here's what is in the libsdl2-2.0-0 package for Debian bullseye:

dpkg -L libsdl2-2.0-0 | grep -E 'lib/.*\.so.*' | xargs ls -lh 
lrwxrwxrwx 1 root root   21 Jun 20  2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.14.0
-rw-r--r-- 1 root root 1.6M Jun 20  2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.14.0

On Arch & Manjaro:

# Package contents
pacman -Ql sdl2 | grep -i libSDL2 | awk '{ print $2 }' | xargs ls -lh
lrwxrwxrwx 1 root root   16 Aug  3 01:41 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0
lrwxrwxrwx 1 root root   23 Aug  3 01:41 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6
-rwxr-xr-x 1 root root 1.8M Aug  3 01:41 /usr/lib/libSDL2-2.0.so.0.3000.6
-rw-r--r-- 1 root root 1.5K Aug  3 01:41 /usr/lib/libSDL2main.a
lrwxrwxrwx 1 root root   14 Aug  3 01:41 /usr/lib/libSDL2.so -> libSDL2-2.0.so
-rw-r--r-- 1 root root 304K Aug  3 01:41 /usr/lib/libSDL2_test.a

# Related symlinks & .so
# Includes my previous workaround symlink farm (added: /usr/lib/libSDL2-2.14.so)
 fd --print0 '^libSDL2.*\.so.*' /usr/lib | xargs -0 ls -lh
lrwxrwxrwx 1 root root   16 Aug  3 01:41 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0
lrwxrwxrwx 1 root root   23 Aug  3 01:41 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6
-rwxr-xr-x 1 root root 1.8M Aug  3 01:41 /usr/lib/libSDL2-2.0.so.0.3000.6
lrwxrwxrwx 1 root root   14 Jun  2 05:42 /usr/lib/libSDL2-2.14.so -> libSDL2-2.0.so
lrwxrwxrwx 1 root root   28 Feb 23 17:12 /usr/lib/libSDL2_image-2.0.so.0 -> libSDL2_image-2.0.so.0.800.2
-rwxr-xr-x 1 root root 122K Feb 23 17:12 /usr/lib/libSDL2_image-2.0.so.0.800.2
lrwxrwxrwx 1 root root   28 Feb 23 17:12 /usr/lib/libSDL2_image.so -> libSDL2_image-2.0.so.0.800.2
lrwxrwxrwx 1 root root   14 Aug  3 01:41 /usr/lib/libSDL2.so -> libSDL2-2.0.so

If we must insist on having hardcoded .so filenames in the source code rather than relying on build-time linkage & dynamic linking (e.g. ldconfig + ld-linux.so and friends)... then we also must find the lowest common denominator across distros for the libSDL2*.so symlink filename. That is to say: Find whichever file name that exists across all distros. If we can find this, then it would be as simple of a change as in #46.

Note: I'm not too familiar with C# / Mono, so take the following with a grain of salt...

It looks like the current code uses "DllImport". Presumably, this functions similar to runtime "dynamic loading" via dlopen() & libdl.so? Again, I'm not familiar with how C# does dynamic linking... :shrug:

If so, and if it's possible to instead compile this mod with dynamic linking against libSDL2 while still having the main KSP game invoke the mod (presumably dynamically at runtime?)... Then maybe we can avoid hardcoding the library name and benefit from the usual ELF binary linking machinery provided by ldconfig & ld-linux.so? In other words: Maybe we can use dynamic linking rather than runtime dynamic loading?[^1]

[^1]: Note: This is sometimes called "load-time" dynamic linking vs. "run-time" dynamic linking on other platforms.

maxtimbo commented 2 weeks ago

I did the workaround, except I only did:

$ sudo ln -s /usr/lib/x86_64-linux_gnu/libSDL2.so /usr/lib/x86_64-linux_gnu/libSDL2-2.0.so.0.18.2
archiecarrot123 commented 2 weeks ago

I'm about to go to bed, but before checking load-time linking I just checked and can confirm that there is a symlink libSDL2-2.0.so.0 on openSUSE and a similar one on Gentoo, so if we are going for runtime linking then it appears that "libSDL-2.0" is the "lowest common denominator".

trinitronx commented 3 days ago

I did the workaround, except I only did:

@maxtimbo: Yeah, that should work with the new changes from #46.

can confirm that there is a symlink libSDL2-2.0.so.0

@archiecarrot123: Yes, that seems to be the case as far as I can tell.

For what it's worth, it looks like so far on distros I've checked, the common filename is indeed: libSDL2-2.0.so.0 [^1]

Expand for all checked distro's SDL2 version + symlink details

#### RHEL family: - openSUSE Leap: ```console $ rpm -ql libSDL2-2_0-0 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 May 7 17:34 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.5 -rwxr-xr-x 1 root root 1.9M May 7 17:34 /usr/lib64/libSDL2-2.0.so.0.2800.5 ``` - openSUSE Tumbleweed 20240819: ```console $ rpm -ql libSDL2-2_0-0 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Aug 16 08:57 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6 -rwxr-xr-x 1 root root 1.9M Aug 16 08:57 /usr/lib64/libSDL2-2.0.so.0.3000.6 ``` - RHEL 8.10 [^1]: ```console $ dnf search sdl Updating Subscription Management repositories. Last metadata expiration check: 0:00:19 ago on Thu Aug 22 22:08:19 2024. ================================================= Name Matched: sdl ================================================= SDL.i686 : A cross-platform multimedia library SDL.x86_64 : A cross-platform multimedia library SDL-devel.i686 : Files needed to develop Simple DirectMedia Layer applications SDL-devel.x86_64 : Files needed to develop Simple DirectMedia Layer applications $ rpm -ql SDL | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 20 Dec 15 2020 /usr/lib64/libSDL-1.2.so.0 -> libSDL-1.2.so.0.11.4 -rwxr-xr-x 1 root root 448K Dec 15 2020 /usr/lib64/libSDL-1.2.so.0.11.4 ``` - RHEL 9.4: ```console $ rpm -ql SDL2 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Nov 22 2022 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.0 -rwxr-xr-x 1 root root 1.9M Nov 22 2022 /usr/lib64/libSDL2-2.0.so.0.2600.0 ``` - AlmaLinux 9: ```console rpm -ql SDL2 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Apr 6 2023 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.0 -rwxr-xr-x 1 root root 1.9M Apr 6 2023 /usr/lib64/libSDL2-2.0.so.0.2600.0 ``` - CentOS Stream 9: ```console $ rpm -ql SDL2 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Nov 22 2022 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.0 -rwxr-xr-x 1 root root 1.9M Nov 22 2022 /usr/lib64/libSDL2-2.0.so.0.2600.0 ``` #### Alpine Linux family: - Alpine 3.17: ```console # apk info -L sdl2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 4 21:45 usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 4 21:45 usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.5 -rwxr-xr-x 1 root root 1.5M Apr 5 2023 usr/lib/libSDL2-2.0.so.0.2600.5 lrwxrwxrwx 1 root root 14 Sep 4 21:45 usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - Alpine 3.18: ```console # apk info -L sdl2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 4 21:48 usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 4 21:48 usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.5 -rwxr-xr-x 1 root root 1.4M Apr 5 2023 usr/lib/libSDL2-2.0.so.0.2600.5 lrwxrwxrwx 1 root root 14 Sep 4 21:48 usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - Alpine 3.19: ```console # apk info -L sdl2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 4 21:49 usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 4 21:49 usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.5 -rwxr-xr-x 1 root root 1.4M Nov 5 2023 usr/lib/libSDL2-2.0.so.0.2800.5 lrwxrwxrwx 1 root root 14 Sep 4 21:49 usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - Alpine 3.20: ```console # apk info -L sdl2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 4 21:49 usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 4 21:49 usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.5 -rwxr-xr-x 1 root root 1.4M Feb 12 2024 usr/lib/libSDL2-2.0.so.0.2800.5 lrwxrwxrwx 1 root root 14 Sep 4 21:49 usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - Alpine edge (`alpine:20240807`): ```console lrwxrwxrwx 1 root root 16 Sep 4 21:57 usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 4 21:57 usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6 -rwxr-xr-x 1 root root 1.4M Aug 5 16:43 usr/lib/libSDL2-2.0.so.0.3000.6 lrwxrwxrwx 1 root root 14 Sep 4 21:57 usr/lib/libSDL2.so -> libSDL2-2.0.so ``` #### Arch Linux family: - Arch Linux (`archlinux:base-20240825.0.257728`): ```console # pacman -Ss 'sdl2$' extra/sdl2 2.30.7-1 [installed] A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2) # pacman -Ql sdl2 | grep '\.so' | awk '{ print $2 }' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 2 13:41 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 2 13:41 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.7 -rwxr-xr-x 1 root root 1.8M Sep 2 13:41 /usr/lib/libSDL2-2.0.so.0.3000.7 lrwxrwxrwx 1 root root 14 Sep 2 13:41 /usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - Manjaro (`manjarolinux/base:20240901`) ```console # pacman -Ss 'sdl2$' extra/sdl2 2.30.6-1 [installed] A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2) # pacman -Ql sdl2 | grep '\.so' | awk '{ print $2 }' | xargs ls -lh lrwxrwxrwx 1 root root 16 Aug 3 07:41 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Aug 3 07:41 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6 -rwxr-xr-x 1 root root 1.8M Aug 3 07:41 /usr/lib/libSDL2-2.0.so.0.3000.6 lrwxrwxrwx 1 root root 14 Aug 3 07:41 /usr/lib/libSDL2.so -> libSDL2-2.0.so ``` - EndeavourOS (2024-08-11): ```console # pacman -Ql 'sdl2' | grep '\.so' | awk '{ print $2 }' | xargs ls -lh lrwxrwxrwx 1 root root 16 Sep 2 13:41 /usr/lib/libSDL2-2.0.so -> libSDL2-2.0.so.0 lrwxrwxrwx 1 root root 23 Sep 2 13:41 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.7 -rwxr-xr-x 1 root root 1.8M Sep 2 13:41 /usr/lib/libSDL2-2.0.so.0.3000.7 lrwxrwxrwx 1 root root 14 Sep 2 13:41 /usr/lib/libSDL2.so -> libSDL2-2.0.so ``` #### Debian family: - Debian 10 (Buster): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 20 Feb 8 2023 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.9.0 -rw-r--r-- 1 root root 1.3M Feb 8 2023 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.9.0 ``` - Debian 11 (Bullseye): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 21 Jun 20 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.14.0 -rw-r--r-- 1 root root 1.6M Jun 20 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.14.0 ``` - Debian 12 (Bookworm): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Apr 12 2023 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.5 -rw-r--r-- 1 root root 1.9M Apr 12 2023 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.2600.5 ``` - Debian Unstable (trixie/sid): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Sep 2 12:53 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.7 -rw-r--r-- 1 root root 2.0M Sep 2 12:53 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.3000.7 ``` - Ubuntu 20.04 LTS (Focal Fossa): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 21 Apr 13 2020 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.10.0 -rw-r--r-- 1 root root 1.4M Apr 13 2020 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.10.0 ``` - Ubuntu 22.04 LTS (Jammy Jellyfish): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 21 May 30 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.18.2 -rw-r--r-- 1 root root 1.6M May 30 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.18.2 ``` - Ubuntu 24.04 LTS (Noble Numbat): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Apr 7 01:16 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.0 -rw-r--r-- 1 root root 1.9M Apr 7 01:16 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.3000.0 ``` - Ubuntu 24.10 LTS (Oracular Oriole): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Aug 2 04:43 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6 -rw-r--r-- 1 root root 1.9M Aug 2 04:43 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.3000.6 ``` - Linux Mint 21.3 (Virginia): ```console # dpkg -L libsdl2-2.0-0 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 21 May 30 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.18.2 -rw-r--r-- 1 root root 1.6M May 30 2022 /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.18.2 ``` #### Mandrake family: - OpenMandriva Lx 4.2 (Argon): ```console # rpm -ql libSDL2_2.0_1 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Nov 2 2023 /usr/lib/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.5 -rwxr-xr-x 1 root root 2.6M Nov 2 2023 /usr/lib/libSDL2-2.0.so.0.2800.5 ``` - Mageia 9: ```console # rpm -ql lib64sdl2.0_0 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Feb 7 2023 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2600.3 -rwxr-xr-x 1 root root 1.9M Feb 7 2023 /usr/lib64/libSDL2-2.0.so.0.2600.3 ``` - Mageia 10 (Cauldron): ```console # rpm -ql lib64sdl2.0_0 | grep '.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Aug 28 13:29 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.6 -rwxr-xr-x 1 root root 2.1M Aug 28 13:29 /usr/lib64/libSDL2-2.0.so.0.3000.6 ``` - ALT Linux Platform 10 (`p10` / "Hypericum") ```console # Note: This distro uses apt-rpm and it's slightly broken in docker image !! # apt-get -y install libSDL2 # Ctrl-c ; rm /var/lib/rpm/.rpm.lock && apt-get -y install libSDL2 ## to workaround # apt-cache show -q libSDL2 | head -n5 Package: libSDL2 Section: System/Libraries Installed Size: 1991260 Maintainer: Nazarov Denis Version: 2.30.3-alt1:p10+350764.100.1.1@1718024201 # rpm -ql libSDL2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 May 3 07:06 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.3 -rw-r--r-- 1 root root 1.9M May 3 07:06 /usr/lib64/libSDL2-2.0.so.0.3000.3 ``` - ALT Linux Unstable ("Sisyphus") ```console # apt-get -y install libSDL2 # Ctrl-c ; rm /var/lib/rpm/.rpm.lock && apt-get -y install libSDL2 # rpm -ql libSDL2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Sep 1 17:38 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.3000.7 -rw-r--r-- 1 root root 1.8M Sep 1 17:38 /usr/lib64/libSDL2-2.0.so.0.3000.7 ``` #### Gentoo family: - Gentoo (`gentoo/stage3:20240902` + `emaint -a sync && emerge --ask=n media-libs/libsdl2` on 2024-09-04): ```console # equery files media-libs/libsdl2 | grep '\.so' | xargs ls -lh lrwxrwxrwx 1 root root 23 Sep 4 22:25 /usr/lib64/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.5 -rwxr-xr-x 1 root root 1.4M Sep 4 22:25 /usr/lib64/libSDL2-2.0.so.0.2800.5 lrwxrwxrwx 1 root root 23 Sep 4 22:25 /usr/lib64/libSDL2.so -> libSDL2-2.0.so.0.2800.5 ```

[^1]: Note: There was one notable exception, RHEL 8.10, which only had SDL version 1.2.15. Presumably, those systems will likely only be servers, but one could theoretically install SDL2 from EPEL (if available), or a manual .rpm package download & install.