Novell Home

Basics: Howto extract and install a variety of application packages on SUSE Linux

Novell Cool Solutions: Feature
By Stomfi

Digg This - Slashdot This

Posted: 30 Aug 2005
 

Question: Here's a question about installing programs on linux. I've tried to install a few things on SUSE Linux and it doesn't seem to work like you outlined in a previous question. I downloaded Firefox and couldn't install it by clicking the file like I can in Windows. I eventually got it installed by searching for the Firefox package in YaST. Now I'm trying to install the Linux demo of Unreal Tournament 2004. Clicking it opens Kwrite with a lot of script. The file is called - ut2004-lnx-demo3334.run I don't know if I have to extract it or what, but any help would be great. Thanks

Answer: For SUSE

My previous answer dealt only with installing application programs in the RPM package format. These have the ".rpm" extension on the end of the file, and can be installed, or at least checked for missing or conflicting dependencies, by using Konqueror to open them and by selecting YaST to perform the install actions.

In this question the user has come across another type of file, and I'll use this as an excuse to describe many of the other types of file you can install on your system, the methods for installing them, and methods for trying, if possible, to update the SUSE RedHat package manager database.

First though, the type of file above is a stand alone executable installer package. If you ever had to install the NVIDIA drivers, these come in the same type of package.

Windows programs are notorious for using this type of installer, which may be easy for the user, but can do all sorts of insecure things, like modifying the MS Windows system shared libraries, so the program can directly use the system hardware instead of going through the application programming interfaces (APIs) as they should. They justify this practice by the increased performance of their application, but how can MS maintain OS security, when it is so easy to compromise their OS system libraries in this way.

Fortunately Linux doesn't use the same OS model, so this type of package shouldn't be able to compromise the OS. The way to install a program of this type in Linux is to open a shell console, cd to the folder where the program resides, In this case the program ut2004-lnx-demo3334.run, and type

sh ut2004-lnx-demo3334.run

The program should install itself. In some cases, like with the NVIDIA driver, the GUI can't be running. There is a Answer in Cool Solutions on how to stop the GUI, install this driver, test and restart the GUI login.

Probably the most common other type of package you will see are tar files. These come in a few different flavours. You can identify them by their file extensions, which will be ".tar", ".tar.gz", ".tgz", and ".tar.bz2".

These packages can be manually opened in the shell, or in many instances, via your file manager, where you can extract them to a folder for running the installation commands. This is like extracting a zip file in Windows with an application like WinZip. The shell commands to open and extract the contents to the current folder are as follows:

package extension opening and extraction command Comments
.tar tar xf packagename.tar standard tar file
.tar.gz tar xzf packagename.tar gunzipped tar file – double compression to save space
.tgz tar xzf packagename.tgz gunzipped tar file – double compression to save space
.tar.bz2 tar xjf packagename.tar.bz2 bunzipped tar file – higher double compression to save space

Unless these are source packages (more on that later), the package is usually extracted to a newly created folder in the current folder with the packagename as its name. For instance unpacking Stomfi.tar in "/home/stomfi" would extract to "/home/stomfi/Stomfi/". Conventionally, but not always so read the INSTALL file, you may see a "configure" file and will see a "Makefile" in the extract folder. If there is a configure file, run that first with the command "./configure". Then you can run the command "make install" to install the program. You will probably have to do this as the superuser (root) as an ordinary user does not have the security permissions to create files in the system folders.

One thing this doesn't do is update the package database. I run a handy program called "checkinstall" instead of "make install". What this does is run the make install and then build a package for your package manager. It will ask you what sort of package. For SUSE you answer R for and RPM. It asks about documentation. I say Y to everything else. You can find checkinstall on the web. Just type its name into your Google bar.

Other packages that are popular are ZIP files. These can have the extensions ".zip", ".gz". and ".bz2". The commands used to extract these into the current folder are: unzip, gunzip, and bunzip. If there is a Makefile you can use "checkinstall" as above; otherwise there will be an INSTALL file or some other documentation on how to install the program. Once again, you will probably have to be the superuser.

Sometime you will come across a package for the Debian distro with the extension ".deb". If you can't find an RPM version, then you can use a package called "alien", which converts one sort or package to another. Usually it works out what sort of package management is on your system, so all you have to type is "alien packagename.deb" and you should end up with "packagename.rpm", which you can install in the usual manner.

The last possibility I will cover here is a source file. Source files often have the letters "src" in their name. After you have extracted the file to a folder, you can compile it into binary code as an ordinary user, but will have to be the superuser to install it.

The modern convention is to have a file called "configure" in the first folder of the program. Read any INSTALL notes first. Run the program configuration with the command "./configure". This script will let you know if all is well or if you need any other libraries to be installed first. When the configuration is successful, run the command "make". This will build the source code into a binary program. Become the superuser and run "checkinstall" as described above.

This answer should cover your question and hopefully any future installs you will come across. One thing to note is that many tar files default to install in "/usr/local" and put their shared libraries in "/usr/local/lib". If you get a message complaining your new program can't find "libraryname.so", this probably means that "/usr/local/lib" isn't in your library configure path.

Become the superuser, edit the file "/etc/ld.so.conf", adding the line /usr/local/lib to the end. Save the file and run the shell command "ldconfig". This will save the information about the libraries in /usr/local/lib in the file /"etc/ld.so.cache". Try your new program again. If this didn't work you can try running it from a shell console where you should see any error messages, and hopefully know what to do to fix them.

This Newbie answer has covered:

How to extract and install a variety of application packages on SUSE Linux.
How to use checkinstall instead of make install to update your package database.
How to use alien to convert a foreign package to your format.
How to build and install a binary package from source code.
How to insert /usr/local/lib into your library loader path.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell