Jump to content

SI-01: How do I install tar.gz's and RPM's?


Recommended Posts

Browse: [About the FAQ Forum] [Table of Contents] [FAQs] [Contribute] [SI: Software Installation]

 

 

SI-01: How do I install tar.gz's and RPM's?

 

There are as many ways to install software on linux as there are penguins in antarctica, but in this FAQ I will describe the two most simple ways, RPM's and .tar.gz's/.tar.bz2's.

 

RPM Installation

 

RPM (Redhat Package Manager) is the packaging system that Mandrake, Red Hat (of course) and some other distributions use.

 

To install a RPM that you have downloaded off the net:

  • In the console:
    	rpm -ivh /location/of/package.rpm


     
    You will have to substitute "/location/of/package.rpm" for the location of the package.
     
    For example, if you have a GAIM RPM for Mandrake 9.1 in your /home directory, you would install it like so (assuming that the user has the name bob, substitute for your username.):
     

    	rpm -ivh /home/bob/gaim-0.74-1mdk9.1.i586.rpm


     
    And to upgrade an RPM that you currently have installed, you substitute the -ivh argument for -Uvh, so to upgrade a version of GAIM to 0.74 (as an example), you would use the following command, like so:
     

    	rpm -Uvh /home/bob/gaim-0.74-1mdk9.1.i586.rpm


     

  • In a GUI File Manager (Like Konqueror, or Nautilus):
     
    To install a package using the File Managers is simple. All you need to do is
    click/double click (depending on your configuration) on the rpm and Mandrakes' (I'm assuming that you use Mandrake) gurpmi tools will choose whether to install or upgrade (depending on if you have the package installed already), tell you any dependencies that the package has (I will talk about these later), and of course, install the package.

Useful rpm command-line arguments:

 

There are many arguments for using "rpm", too many to list here in fact, so I will summarise some of the most useful options for installing and upgrading RPMs.

  • -v This will print verbose information to the screen when installing an RPM.
  • -i This installs an RPM package.
  • -U This upgrades an RPM package.
  • -h This prints 50 hash marks (#) while package archive is unpacked.
  • --nodeps This tells "rpm" to not perform a dependency check before installing an RPM.
  • --oldpackage This allows an old package to replace a newer one.
  • --replacefiles This makes "rpm" install files even if they replace files from other packages.

You can get a Complete summary of the options by typing "man rpm" at the command line.

 

RPM dependencies

 

Dependencies would probably be my most hated part on RPM installations.

 

You get dependencies when a package relies on some other package to be able to function. The only simple solution to RPM dependencies is URPMI. (Refer to LiquidZoo's FAQ for information on how to use URPMI, which you can find here.). Otherwise you will most likely end up searching for days on the net, which is a huge hassle.

 

.tar.gz Installation

 

.tar.gz's come with many different contents, from binaries, to source packages, i will cover the default installation of both types, so you should be able to install most of the .tar.gz packages you find on the net, and if not, there should always be a README and/or INSTALL file with installation instructions.

 

.tar.gz Source Installation/Compilation

  • First you must extract the .tar.gz
     
    To do this, you use the command "tar", like so:
    	tar -xzvf /home/bob/compressedfile.tar.gz


     
    This command would extract the contents of the file "compressedfile.tar.gz" into the current
    directory. If you didn't issue this command from the "/home/bob" directory (substituting "bob" for
    your username of course), "tar" would try and extract the contents to whatever directory you are in, showing an error if you do not have permissions to the directory. You can find the current directory you are in with the command "pwd" (Present Working Directory).
     

  • Now you "cd" into the location of the source code
     
    For example, MPlayer 0.91 when extracted creates a directory "MPlayer0.91/".
    So, to go into this directory wou would use this command:
     
    	cd MPlayer0.91/


     
    This should be similar to any other software that you download (with, of course, a different name)
     
    Compiling & Installing it
     
    Most Linux software follows the same conventions when packaging their software, and with most
    software, only four commands should usually be needed. They are used in the order shown below:
     

    ./configure
    make
    su
    make install


     
    The configure command, oddly enough, configures software for your computer and checks if you have everything needed for it to build.
    The make command compiles the software.
    The su command allows you to log in as the root user (all powerful admin).
    And finally, make install installs the compiled software as the root user.
     
    NOTE: Sometimes when using ./configure you get an error that you are missing some "devel", or
    "development" packages, for example, I got the following error compiling Gaim (gaim.sourceforge.net)
     

    	*** GLib 2.0 is required to build Gaim; please make sure you have the GLib
    *** development headers installed. The latest version of GLib is
    *** always available at http://www.gtk.org/.


     
    Sometimes, the ./configure script will tell you where you can find the missing package (as above), sometimes it will, not, if not, you can either search for the rpm, there are some useful sites for doing this like:
     
     

  • pbone.net
  • rpmfind.net

Development packages usually have the -devel suffix in the filename

 

The Mandrake (or whatever distribution you use) cds you have contain many of the development packages that you should ever need. The net should only be a last resort for finding packages

 

You will usually find more accurate and extra information in the README and/or INSTALL files

contained with the software about the different compile options.

 

 

.tar.gz Binary Installation

 

Some software packages, with realplayer as an example, distribute their binaries in a .tar.gz and not source code, these are much easier to install, first you extract the contents of the tar.gz and then run the binary like so:

 

./nameofbinary

 

As you can see, you precede the name of the binary with './'

 

NOTE: Sometimes, if you can't use "./nameofbinary", you will need to make the file executable, you do this like so:

 

chmod +x nameofbinary

 

.tar.bz2 Software

 

Bzip2 files use a newer and much better compression algorithm than gzip (.gz) and are just as simple to use.

 

You uncompress them like this (as an example):

tar -xjvf /home/bob/compressedfile.tar.bz2

 

And you can follow the same instructions as for .tar.gz's for installing/compiling the software.

 

If you have any suggestions, comments, corrections etc, you can send me a PM.

Link to comment
Share on other sites

 Share

×
×
  • Create New...