Using zypper to determine what package contains a certain file (include zypper cheat file)

Lets
say that you are trying to run a piece of software but it comes up with
an error like:
Code:

# error while loading shared libraries: 
libpng12.so.0: cannot open shared object file: No such file or 
directory

You can use zypper to determine what package that library
belongs to by using 'zypper wp':
Code:

# zypper wp 
libpng12.so.0
Loading repository data...
Reading installed packages...
S | Name             | Type    | Version    | Arch   | Repository       
--+------------------+---------+------------+--------+------------------
 | libpng12-0       | package | 1.2.44-2.1 | x86_64 | openSUSE-11.3-Oss
 | libpng12-0       | package | 1.2.44-2.1 | i586   | openSUSE-11.3-Oss
 | libpng12-0-32bit | package | 1.2.44-2.1 | x86_64 | 
openSUSE-11.3-Oss

 

Code:

# zypper in 
libpng12-0

Then that application should run fine.

Credits