Resolving missing packages on Ubuntu

Tags:

So I tried to install simutrans on Ubuntu 8.10 and get this error message:

./simutrans/simutrans: error while loading shared libraries:
<strong>libSDL_mixer-1.2.so.0</strong>: cannot open shared object file:
No such file or directory

Note the filename I put in bold -- apt-get rejects commands like:

# <strong>apt-get install libSDL_mixer</strong>
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Couldn't find package libSDL_mixer

Well, that's not too helpful. Apparently the package name isn't the same as the file the loader is complaining about. How do we find it? Try this to search the package database:

# <strong>apt-get install apt-file</strong>
# <strong>apt-file update</strong>

and then you will be able to do a search which returns useful results:

# <strong>apt-file search  libSDL_mixer-1.2.so.0</strong>
<em>libsdl-mixer1.2</em>: /usr/lib/libSDL_mixer-1.2.so.0
<em>libsdl-mixer1.2</em>: /usr/lib/libSDL_mixer-1.2.so.0.2.6

Aha! What we want is libsdl-mixer1.2 (Different capitalization and a hyphen instead of an underline, with the "-1.2" replaced by just "1.2"... who thinks these things up?)

Finally we do:

# <strong>apt-get install libsdl-mixer1.2</strong>

and... success!