Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Apr 2003
    London, UK

    HOWTO - Install Software [README]

    Installing Software in GNU/Linux

    For the benifit of people new to Linux, I have written a generic explaination of howto install software in Linux. Note that some software may have specific installation proceedures, this HOWTO is not a substitute for reading the offical installation documentation

    This HOWTO covers the following topics:
    • Compiling and Installing software from source
    • Installing RPM's using the Redhat Package Manager
    • Installing using Debian's apt-get
    • Installing mandrake things
    • Installing with fedora / yum
    • Installing slackware packages
    • Installing software using Gentoo EMerge

    If you have just installed GNU/Linux and would like to know how to install software on your new OS, I would recommend you read the "Compiling and installing software from source" section, as well as the section specifically for your GNU/Linux Distribution. Do not worry if you dont understand or remember everything written here straight away, book mark this page and use it as a reference page later on.

    Compiling and Installing software from source
    Some software is distributed in "Source form". This means you download a file containing all the source code for the application you want to install, unpack it, and compile it on your system. Compiling is the process of turning the source code into an executable binary. The common myth and newbie assumption is that this is very hard todo, or it is only for programmers. Wrong. It is a fairly straight forward process, and you will find that a lot of software you install will need to be built from source.

    Typically applications you must compile from source will come as a ".tar.gz", ".tar.bz2", or ".zip" file.

    For organisational purposes, I like to save my source zip file to /usr/local/src/, but this is totally up to you. For the rest of this section we will assume you have downloaded your zip file to /usr/local/src/. If you do not have a /usr/local/src directory, you can create it with the following "mkdir" (make directory) command:

    mkdir /usr/local/src/
    So, we have our source package in /usr/local/src/.

    Change to the /usr/local/src/ directory with the "cd" (change directory) command like so:

    cd /usr/local/src/
    Use the "ls" (list directory contents) command, to see the file is present:


    We now need to unzip the zipped file, this is done differently depending on the file extension.

    for files ending in .tar.gz, use:
    tar -zxvf <filename>
    (replacing <filename> with the name of the file).

    for files ending in .tar.bz2, use:
    bunzip2 <filename>
    for files ending in .zip, use:
    unzip <filename>
    You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again.
    we now need to go into the new directory, so use the cd command:
    cd <directory>

    This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so:
    more INSTALL
    Generally, the final 3 stages are as follows:
    - Configure the installation
    - Compile the software
    - Install the binaries

    The pre-installation configuration is done by executing ./configure:
    This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled. If you receive any error messages during this stage, you may wish to search the forums to see if they have been found and resolved by someone else already, if not, feel free to post a question on the forums - Please include all of the output including any error messages, and some details about your system - what distro you are using, what are you trying to install etc etc

    The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries.

    The final stage is to install these binaries, ie, copy them to a more perminent location. Typically only the "root" user can do this, so you will need to swich to the root user with the "su" command:
    Once you are root, install the binaries using the "make" command, followed by "install", like so:
    make install
    That is it!. Check the user documentation of the software you installed for details of how to run the application.

    Remember that if you have any problems, please post in the most relevant section of the forums. - When posting, remember to include as much info as possible, including all output and error messages.

    Installing RPM's using the Redhat Package Manager
    Redhat RPM's offer a flexable and easy method to install new software. Software installed from an RPM package differs from compiling from source in a few ways, but the most important one of all is the software is already compiled for you. Essentially all you are doing is extracting the pre-built binaries and copying them to their pre-selected destination. RPM's are files that have a ".rpm" extenstion. The good point about RPM's is installation of new software, and maintaining the software currently installed is much easier than doing so for individual packages compiled from source. The downside to RPM's is that you dont have as much choice about where software is installed on your system, how it is compiled, and how it is configured.

    Using the RPM system is fairly straight forward. To install a package, you can use the following command:
    rpm -i <filename.rpm>
    When using rpm, you must be logged in as the root user. The "-i" flag in the above command means "install".

    Un installing a package is just as easy:
    rpm -e <package>
    The "-e" switch used here means "erase" (un install).
    Note that <package> is different from <filename> used when installing.

    For example, if you are installing an application called "mysoftware", you may use a command like "rpm -i mysoftware-1.0.2-i386.rpm" to install "mysoftware", when removing we dont follow the filename for installation, but rather the name of the software itself.

    For further uses of RPM, please use "rpm --help" and "man rpm". Also see this page, which has some fairly useful information.

    If you need to find & download the RPM file for a piece of software, I recommend using
    RPM Find and RPM Pbone Search Note that not all applications are available as RPM's, in these cases you will need to compile the software from source. (see above).

    Installing using Debian apt-get
    Apt-Get is a wonderful package management system for Debian GNU/Linux. Apt-Get, like RPM make installing and managing installed software easy, and once again has the same disadvantages that binaries are pre-built and cannot really be fine tuned to your system very well. I really like Apt-Get becuase of its automatic software download and upgrade mechanisms, and unlike Redhat doesnt keep trying to sell you something, and doesnt try to limit your use of the system.

    The most powerful feature of apt-get surely is that you dont manually have to find & download the software you want to install, apt-get will do this for you, and also resolve any software dependencies. Before you can use apt-get for the first time, you must do a small bit of configuration.

    You need to edit your /etc/apt/sources.list file, to specify the locations of Debian packages. You will proberly want your default sources.list file to look something like this:
    deb http&#58;// stable main contrib non-free
    deb http&#58;// stable/non-US main contrib non-free
    deb http&#58;// stable/updates main contrib non-free
    If you would like to use more upto date software on your machine, you will proberly want your sources file like this:
    deb http&#58;// sid main contrib
    deb http&#58;// sid/non-US contrib
    deb http&#58;// stable/updates main
    The first sources.list file uses the stable branch of debian packages. Software installed when using the stable version has undergone more testing, and in theory has less bugs. However, the software on the stable branch is usually much older versions, so you may be missing out on new features etc. The second example sources.list uses the UnStable branch. This means you will get newer versions of software, but you may occaisionally run into bugs which have not yet been fixed. I myself use and recommend using the unstable branch, the software on the stable branch is 2 or 3 years behind the unstable.

    Once you have confirmed your sources.list file, we need to update our local list of packages that are available for installation. To do this, use the following command after logging in as the root user:

    apt-get update
    After updating the list, you can install applications like so:
    apt-get install <program>
    To see a list of available programs that you can install, or to find a particular program, we can use apt-cache, like so:
    apt-cache search <something>
    Replace <something> with a application name or word. Eg, to find an irc client to install, you could execute
    apt-cache search irc

    To uninstall software is fairly straight forward also.
    apt-get remove <application>
    replace <application> with the name of the program you want to remove.

    A word of caution: If you try to remove a piece of software that other pieces of software depend on, apt-get will also want to un-install those other pieces of software as well. Becareful you dont end up uninstalling your entire system!. apt-get will prompt you before removing any additional packages so watch carefully!

    Installing software on Mandrake with urpm
    urpm is a nifty was to install software on any 7.x or greater Mandrake system. Some of the advantages of Mandrake's urpm utilities are:

    * It automatically solves package dependencies issues by installing or uninstalling dependent packages.

    * It installs packages and dependencies directly from the internet.
    * It allows globbing of package names
    * It will automatically update your system.
    * It will install all those "not allowed to distribute" programs that you really want to have (DVD support, MP3 enoders, etc...)

    How do I install urpm?
    urpm should be installed by default on any modern Mandrake distobution. If it's not, you can install it using the Mandrake Control Center (MCC).
    urpm Commands

    The most commonly used command is urpmi. This command allows you to install packages from your configured sources (see below). urpmi will try to install all package dependencies. It will also take partitial names and give you a list of available packages. For exmaple, if you wanted to install one of the kdemoreartwork styles, but didn't know the exact name, you simple type

    &#91;root@cayanne ~/&#93;#urpmi kdemoreartwork
    and it should return a list of packages not already installed on your system. This also means it will install the most up to date package for your system, you don't have to know which version you're looking for. As an exmaple, you may wish to add DVD Play back support to your computer. This can be done by installing any video player, such as Xine or MPlayer, along with the package libdvdcss. Rather then having to type in urpmi libdvdcss-1.2.1-1.i386.rpm, you can simply type in

    &#91;root@cayanne ~/&#93;#urpmi libdvdcss

    The urpme command deletes, or erases, currently installed packages and all packages depandant on that it.

    The urpmq command searches for, or queries, for packages that you list.

    The urpmf command does an advanced search for a filename in all known packages. For example if we are trying to compile a program and the configure script is complaining about not finding ncurses.h, we can do a urpmf ncurses.h to find that it is part of the libncurses5-develpackage.

    &#91;root@cayanne ~/&#93;#urpmf ncurses.h

    urpmi.addmedia does exactly that, makes an rpm reposatory available for urpm to utalize. Typically, you have your installation cd's available as a default media, these are called main. In addition, you also have three other media - updates,contrib and PLF. Updates is the updates, and contrib is user contributed rpm's and PLF is all those not available for distribution for so-called legel reasons rpm's. The sysntax for urpmi.addmedia is

    urpmi.addmedia [media-name] [ftp-address with] ../base/
    Note that the is required. For example, to add medium 'contrib', we use the following command

    &#91;root@cayanne ~/&#93;#urpmi.addmedia contrib ftp&#58;// with ../base/
    added medium contrib
    retrieving description file of "contrib"...
    ...retrieving done
    retrieving source hdlist &#40;or synthesis&#41; of "contrib"...
    ...retrieving done
    examining whole urpmi database

    This command removes specified media. Need I say more?

    The urpmi.update command goes through all of your media sources and updates your installed packages if necessary.

    How do I set up urpm?
    urpm can be set up using MCC, but I've personally found the instructions at the web-site to be a little easier. Either way, you can use the site along with MCC or the console to add media. Simple follow the step-by-step instructions, and enter the command it prints out in the grey box into any terminal window, as root of course. You can even copy and paste the command, there's no need to type it all in.

    Now that you're up and running with urpmi, try to install a few packages! Have fun!

    Where can I get more info?
    Here's couple of places to get more info (these are the places where I got my references):

    Mandrake FAQ
    Mini How-To

    Some site in Texas

    Installing with fedora / yum

    Installing slackware packages
    Slackware packages are usually .tgz files containing pre-built binaries. To install software in slackware you will need to find and download the .tgz package manually beforehand. If you are looking for a slackware package for a piece of software and have not found it yet, search Linux Packages for it.

    Ok, once we have our package, lets install it. To install slackware packages, ensure you are the root user using the command:
    Now run the following command to install the package:
    installpkg <packagename.tgz>
    Uninstalling a package is also quite simple:
    removepkg <packagename>
    Also worth noting about slackware packages, is a utility called pkgtool which will allow you to install, remove and list packages on your system. To use pkgtool, run:
    and follow onscreen prompts.

    Anyone who likes the debian apt-get system but is currently using Slackware may be interested to hear about a utility called slapt-get, the Slackware answer to apt-get. Slapt-get is avaible from Here. There is also a nifty Gnome/GTK front end for slapt-get in development, you can preview it at the same url.

    Lastly, if you are having trouble locating a slackware package, but have been able to find a equivilent RPM, you can "convert" that RPM to a slackware package which you can use with the installpkg and removepkg commands. To convert your RPM to .tgz, use the command:
    rpm2tgz <packagename>.rpm

    Installing software using Gentoo EMerge

    Further reading

    Copyright, Re-Printing, and comments
    This document is copyright Jason Lambert, 2004.
    The mandrake section is contributed by jeremy1701 and is copyright jeremy1701 2004.

    You may not re-produce or reprint this document in part or in full without my prior written permission..

    If you would like to request permission to re-print any part of this document, please send me a private message on the forums.

    The mandrake section may not be reprinted without written permission of jeremy1701

    All trademarks remain the property of their owners etc.

    If you have a comment about this howto, please Email Me. Please do NOT email me or send me a private message asking for technical assistance. If you need help please post on the forums!

    -- EOF --

  2. #2
    Just Joined!
    Join Date
    Oct 2004
    Thanks for the guide, helped me understand what was happening when compiling source. Is there a utility that lists which packages are installed by hand for suse?


  3. #3
    Linux Guru
    Join Date
    Apr 2003
    London, UK
    Quote Originally Posted by jadurant
    Thanks for the guide, helped me understand what was happening when compiling source. Is there a utility that lists which packages are installed by hand for suse?

    rpm -qa
    should list all the packages installed (warning - may be a long list).

    if there is a specific package you want to know if its installed, do:

    rpm -qa | grep -i <NAME>
    where <NAME> is the name of the package / application.

  4. $spacer_open
  5. #4
    to make this more complete maybe you can add how-to install from src.rpm files using rpmbuild.

  6. #5
    Would be helpful if this tutorial provided a brief overview of the most common places that program files are installed to. My problem is that I don't know where I should be putting all the programs I install, /usr/bin sounds good for most things but I don't like throwing more crap into a folder full of crap, so mostly I end up installing to ~/bin. Also some dependency information would be helpful, like what happens when you install something as root as compared to what may happen if you install the package under a regular user account.

  7. #6

    Great work!

    It was ver thorogh informative and to the poit. Being a newbe it clarified a lot. However I am a fedora user I would have loved to know more about yum.

  8. #7

    Re: Great work!

    Quote Originally Posted by agustr
    It was ver thorogh informative and to the poit. Being a newbe it clarified a lot. However I am a fedora user I would have loved to know more about yum.

    Good luck

  9. #8
    Just Joined!
    Join Date
    Dec 2004
    Very nice How-To. I remember when I couldn't find anything like that, because everything else I found made what to do very confusing, and all the different ways just made it super confusing as a reader.

  10. #9
    Just Joined!
    Join Date
    Dec 2004
    Very helpful !

    I have searched for those "How-to" a lot, but never found something this simple.



  11. #10
    Just Joined!
    Join Date
    Jan 2005
    New Zealand

    Re: HOWTO - Install Software [README]

    Quote Originally Posted by jasonlambert

    I've personally found the instructions at the web-site to be a little easier.
    Re Mandrake installation - this link appears to be dead.

    A search on the site found:

    Hope this helps.

    Happy New Year!
    Cheers, Kath.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts