Installing Software on Linux

Discussion in 'Software' started by goldfish, Dec 12, 2006.

  1. goldfish

    goldfish Lt. Sushi.DC

    This is just a quick tutorial on how to install software using Linux. It's extremely generic, and for precice instructions on how to get a particular bit of software you need to look for instructions on that piece of software specifically.

    I've assumed a few things, such as the use of sudo. If you don't use sudo (and you should be ...) then simply replace it for
    Code:
    su <ENTER>
    Password: <your password><ENTER>
    # command
    
    To get out of a root shell, type exit
    There are a couple of methods you can use to install software.

    1. Use your package manager

    This is by far the simplest way to install software.

    It depends on your distribution as to how you go about this. For example on a Debian based distro (including Ubuntu) you can do this:
    Code:
    sudo apt-get install <your software>
    
    You might also want to look for the exact name of a package, in which case you would type the following:
    Code:
    sudo apt-cache search <package name>
    
    On Gentoo, you would use the following:
    Code:
    emerge <your software>
    
    On an RPM based distro, you would first download the .rpm file and do this:
    Code:
    rpm -i <filename of rpm file>
    
    Some distros such as Ubuntu come bundled with a graphical package manager, such as Synaptic. Read the documentation on how to use these to install software. This can be more intuitive when you're looking for software.

    2. Install from Source

    This is a bit trickier. First you would download the source package from the maintainer's website. Then you would un-compress the package into it's constituent parts. This is typically done using tar:
    Code:
    tar xvfz mypackage.tar.gz
    OR
    tar xvjf mypackage.bz2
    
    The z option is for gzipped files (extension .gz or tgz) and the j option is for b-zipped files (.bz2)

    Once you have done this navigate to the directy where the files have been extracted.
    Code:
    cd mypackage/
    
    Take a look at the files in there using ls. You may want to read the README or INSTALL file
    Code:
    less README
    
    Now you've read the documentation, you'll need to configure the program.
    Code:
    ./configure
    
    The INSTALL file should tell you what options you can set using the configure script. For example, if you wanted to compile something with XVID support, you might add the command line option
    Code:
    ./configure --with-xvid
    
    You might get an error when you try to configure the program. This is usually because you are missing a package. Remember that when you go to install a package, in the generic case the name will be as such:
    lib(name)-dev
    Make sure you get the -dev package as this contains the libraries which the configure script requires.

    If you get any other errors, you might want to google bits of it and see if anyone else has reported the same problem, and how they solved it. If you can't find anything you might try posting in the maintainers forum, or your distro's forum.

    Once you've successfully configured your program, you need to compile it.
    Code:
    make
    
    In order to compile programs you'll need to have the compilers installed. In Debian, you can install a psudo package which installs all programs required to compile software - it's called build-essential.
    Code:
    sudo apt-get install build-essential
    
    Again if you get any errors, then google them.

    Once you've successfully compiled the software, you'll need to install it. For this you need root privileges. You need to either su to a root shell:

    Code:
    su
    Password:
    [mybox@mydomain] # make install
    
    Or use sudo

    Code:
    sudo make install
    
    And that's it done! Read the documentation on your software on how to use it ... and have fun with it :)
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    Niiiiiiice, Goldie!
    I think this is exactly what a few newer users need!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds