Monday, March 11, 2013

How to install a package and resolve dependecies issues

I'm not using any packet manager in Slackware (I don't even know if there's one that can manage dependencies), so I have to install manually the packages I need. Sometimes this isn't so easy, because for running a program you often need other programs or libraries, and they aren't already installed.

So, let's see an example. let's suppose you want to install transmission, a light-weight BitTorrent client.

Step one: find and install a package 

This one is simple: if it's pre-compiled you can find it in your install CD/DVD, in the online Slackware mirrors (my advice is to search the package name in the list of packages, like this one) or on slacky.eu where you should search the package name in the right repository (in my case, 13.37 32bit). There it is:
wget http://repository.slacky.eu/slackware-13.37/network/transmission/2.42/transmission-2.42-i486-1sl.txz

Once downloaded, run as root installpkg to install it:
# installpkg packages/transmission-2.42-i486-1sl.txz
Verifying package transmission-2.42-i486-1sl.txz.
Installing package transmission-2.42-i486-1sl.txz:
PACKAGE DESCRIPTION:
# Transmission (GTK+ Lightweight BitTorrent client)
#
# It  features  a  simple,  intuitive interface   on top on an 
# efficient  cross-platform  back-end. Gtktransmission is open
# source (MIT license)interface). and runs on Mac OS X  (Cocoa
# interface),  Linux/NetBSD/FreeBSD/OpenBSD   (GTK+ interface)
# and BeOS (native interface).
#
Executing install script for transmission-2.42-i486-1sl.txz.
Package transmission-2.42-i486-1sl.txz installed.

Step two: find missing software and libraries

If trying to run your newly installed software ends up with an error like this...

:~$ transmission-gtk
transmission-gtk: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

... you're missing someting. Let's find out what, running ldd on where the main executable script is placed (usually /usr/bin/).

:~$ ldd /usr/bin/transmission-gtk | grep not
        libevent-2.0.so.5 => not found

There it is: libevent is missing. It's a library, so it could be contained in a package named in some other way, but a quick search for "libevent-2.0.so.5" on pkgs.org will tell you the package name you need. In this case, libevent.

At this point another search on slacky.eu and you will get your missing package:
wget http://repository.slacky.eu/slackware-13.37/libraries/libevent/2.0.11/libevent-2.0.11-i486-1sl.txz
installpkg libevent-2.0.11-i486-1sl.txz

Done! Now you have all you need to run transmission-gtk. :)

But what if...

.. you can't find a pre-compiled package to install? Well, in that case you should search for a SlackBuild script to make one, or download and compile the source package.

No comments:

Post a Comment