Managing Shared Libraries and Installing Software from Tarballs

Many Linux applications do not install properly, or do not function without the presence of required shared libraries.  These libraries are nothing more than files that must be in the correct place.  Since many distributions of Linux vary the exact location of many files, soft links play a big role in helping applications run, and it allows an applications installation script to locate the library natively on the file system and then create links to it that the application can use.

You can list the libraries that an application requires by using the [ldd] command.  Be sure to supply the name of the binary you want to create a listing for.  The following command will list all the libraries required for the [ls] command.

ldd /bin/l

If you are attempting to install an application, you may receive an error stating that dependencies are not present.  This means that the application requires certain shared libraries to function, and those libraries are not installed.  In this case you have two choices.  You can install the application (rpm) using the –nodeps switch to ignore the missing dependencies and install anyway.   The application will probably not work until you get the missing pieces installed.

Installing an Application Using a Tarball

Tarballs have been a traditional method of making applications available and are still widely in use today.  By definition, a tarball is an application that has had all of its files packaged into a single file for distribution.  Before use, the application must be extracted from the tarball.  Once extracted, the user would then run a packaged script to configure the application and complete the installation.  Most tarballs are also zipped using a program such as [zip] or [gzip].  Zipping has the effect of reducing the overall size of the package, and thus the overall download time.  Note that an application is first tarballed, then zipped as the [zip] and [gzip] commands only work on a single file.  Below are the contents of a CD containing the Samba 2.2 RPM and a tarball for Apache 2.0.

In order to unpack Apache, we must perform a few steps.

1. Copy the files from the CD to a temporary directory on the hard drive.

2. Unzip the files.

3. Untar the files.

Figure 

A few conclusions can be drawn from this process.

  • When tarballs are unzipped, it does not create an additional file, it modifies the existing one.
  • Once a tarball is extracted, the extracted files are placed in the same directory as the tarball.  This can be important as the installation instructions for some files require that the files be untared in a particular location.
  • The –xf switch, extracts the files.  A common switch is –xvfz, which will extract the files, giving you a verbose listing of the files being extracted, and will unzip the file before doing so.

Now you have to follow the installation instructions for your particular software package.  In the case of Apache 2.0, these can be found in the httpd-2.0.35/INSTALL file, which directs you to read httpd-2.0.35/docs/manual/install.html.

Note:  To complete the installation of Apache, you will need a C++ compiler on your system.  The install script is pretty straight forward, but unless you installed the cc or gcc compiler during installation, you will need to get them.  The gcc compiler ships on Disc 2 of Red Hat, but is broken into a dozen or so smaller RPM’s.  It’s a challenge to install.

Conclusion

That’s pretty much the skinny on installing software.  If you are on Debian, or some platform that supports Debian packages, you will have a tool and command set very similar to RPM.  Unfortunately there is not yet a standardized installation interface, as there is on Windows, so you my find installing some packages challenging, depending on the form they come in and how readily available tools such as compilers are.  Tarballs are more challenging to install than RPM’s, but usually have some common features.  There is usually a README file, and INSTALL file and a [./configure] command.  The INSTALL will tell you what arguments to provide to the [./configure] command.  This command is nothing more than a shell script that compiles the program, and places the appropriate files in the appropriate locations.