Skip to main content

Installing Applications Under Linux

INSTALLING APPLICATIONS UNDER LINUX(Fedora,RedHat,Debian )

Installing applications under Linux has been a major stumbling block for Linux newbies , even though the situation has improved with automatic installers (Like yum,aptitude,autopackage etc) but still applications installation under Linux is a tricky affair . So i decided to share whatever i know about installing applications under Linux with the Linux Newbies via my blog.


Installing rpm packages on Redhat,Fedora Based Systems : - For Fedora based systems rpm is the standard format for packages , it stands for RedHat Package Manager .The files have ".rpm" extension . The rpm format's major advantage is it is easier to maintain applications installed using rpm than compiling from different sources.Also various dependencies for applications are previously determined before installing the applications hence it ensures error free running of application after installing the application.

To install a rpm package use command:
rpm -i PackageName

TO uninstall rpm package use :
rpm -e PackageName
PackageName is different from filename You used to install the package . This is actually the name of software that is installed.

If you have some file on your system and you dont recognize to which package it belongs use the command : -
rpm -qf filename with path
this would return the name of package the file belongs to.

If you have a rpm package but you are unsure about the package that is it's name ,description etc use this command to get information about the package: -
rpm -qpi package name

If you want to know what files and where the rpm installs for a specific package use the following command : -
rpm -qpl packagename

If you want to upgrade an existing package on your system use :-
rpm -Uvh packagename
this command uninstalls the old version of the package and installs the new version of the package.This commands works even when there are no existing version of application installed hence this can be effectively used for Installing new packages.

However freshen(-Fvh) option dosent install new package if it dosent exist and only upgrades existing package on the system.This can be particularly useful if you have a number of packages and only want to upgrade the packages and don't want to install new packages.

You can use the command
rpm -Fvh *
For the above purpose


rpm -qa | less
Views list of installed applications , one screen at a time.

rpm -qa
List all applications installed on the system

rpm -qa | grep -i
To search if a particular package with is installed on the system.



Installing packages under Debian GNU/LINUX based distributions : - Debian Linux based distributions like Ubuntu,Kubuntu ,Debian etc come with an excellent package management system (apt-get) which allow for installation of software with relative ease. Debian has been traditionally easier of Linux distributions in view of software installation.Debian Linux uses the deb package format for packaging software similar to the rpm package on Redhat and fedora based systems.

However before one starts using apt-get software repositories have to be set-up correctly on the local machine. Repositories are a collection of software's stored on the Internet which could be used for installation of software using apt-get. The location of repositories is stored in the machine in the file /etc/apt/sources.list and could be modified for removing or adding additional repositories locations. A comprehensive list of available repositories could be found at www.apt-get.org .

After completing setting up of repositories one has to make local database on the machine storing information about software's in sync with the repositories making the information about package available on the net locally available and could be done with command .

apt-get update


Now once the package information is cached locally one can Install applications or search for available package using command. However one has to be connected to Internet for installing software though software could be searched without the Internet.

apt-get install packagename

One important feature of apt-get is that user is shielded from the trouble of dependency . If a application needs additional libraries,package etc to be installed they are automatically searched from the repositories and installed before installing the application . This is one of the most important feature of installing application through apt-get.

To search for a particular package in the database stored locally.

apt-cache search packagename


To upgrade all the software's on the system

apt-get upgrade

To remove a particular package

apt-get remove packagename


apt-get autoclean

Above option cleans packages in cache that are found useless or partially complete and deletes them.

Installing Debian(.deb) Packages :-
Debian Linux distribution unlike other is not maintained by any particular organization but maintained by volunteers . The Package used by Debian and all distributions based on it is deb . dpkg is the tool that is used for installing applications on Debian based systems.

dpkg --install
To install a package or upgrade on the system.The name is the complete name of package file ending with .deb extension . If all the packages and libraries needed by the package your are installing is found on the system the installation proceeds and package is installed. However if some library is missing or files needed by package is not found on the system appropriate error would be shown and dpkg would exit showing error.


dpkg --remove
To Remove already installed application from the system. However this command does not remove the configuration file that may be needed for re installation of package however if you want to remove the configuration file also . Following command could be used :-
dpkg --purge

dpkg --status
Above command displays the status of package specified.

dpkg --listfiles
Above command lists the name of all the files installed by package specified as

dpkg -l '*' | grep '^i' | more

Above command displays all the installed application on the system page wise.


dpkg -l 'gtk*' | grep '^i' | more

Above command displays all the installed applications on the system beginning with name gtk.

However one can also use dselect to install or remove applications on the system. dselect is a menu driven application

for installing and removing application.


Installing applications using yum : -

Similar to apt-get on debian based system . Redhat and Fedora ships with yum for installation of applications from repositories.

The installation of software gets very easy with the help of yum.

yum stores the repositories address in the file /etc/yum.conf . Initially it has only few repositories and should be expanded to

include more for example i added the following :

[livna-stable]

name=Livna.org Fedora Compatible Packages (stable)

baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/yum/stable

gpgcheck=1

[FedoraUS]

name=Fedora US $releasever - $basearch - Latest Packages

baseurl=http://download.fedora.us/fedora/fedora/2/i386/SRPMS.os/

[newrpms.sunsite.dk]

name=Fedora Core 2 NewRPMS.sunsite.dk

baseurl=http://newrpms.sunsite.dk/apt/redhat/en/i386/fc2

[dag]

name=Dag RPM Repository for Fedora Core 2

baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag

[dries]

name=Extra Fedora rpms dries - $releasever - $basearch

baseurl=http://dries.studentenweb.org/yum/fedora/linux/$releasever/$basearch/dries

After completing above one should run

yum -y check-update

This command downloads header , information about all the new software available and stores it locally.

yum -y list

Above command displays the list of all the packages available for installation.

yum -y list installed

Above command displays the list of all the packages installed on the system.

yum -y install packagename

Above command downloads and installs the package after searching it in the repositories. This also downloads all the dependencies

and installs it ,before installing the package.

yum update

Above command updates all the upgradable packages on the system.

yum remove

Above command removes the package specified as

yum list recent

Above command displays the list of all the applications recently installed or updated.

yum provides filename

above command displays the package the filename belongs to.

Installing from sources : Most of the Open-Source application available under Linux is available as Source Code which needs to be compiled at the users end. This approach though is time consuming since compiling an application takes a descent amount of time depending on the complexity of the application, Also installing from sources is a bit more complex than installing from binaries. But still it does have it's benefits , The applications compiled can be significantly faster than the binaries downloaded since they are optimized for your system also there are many situations when binaries are not available for your Processor or Distribution and hence compiling application from the source is the only option.

Step 1: Download the source file from the Internet usually the source files are tar archives. Extract it into a directory using the tar command.
Example if you download the file : examples-0.1.2.tar.gz

Extract with: tar -xzvf examples-0.1.2.tar.gz

-x extract the file
-z unzip it (required for .gz files)
-v verbose, print the names of the files as they are extracted
For archives starting with .tar.bz2 use bunzip2 filename for extracting the file.

after extracting the file go into the directory of the created file and execute the configure script which configures the packages source file according to your system and checks if all the needed libraries are present ,This tells how software must be compiled.If an error is shown during the execution of configre script look for the missing library and install it and then rerun the configure script. After completion of the configure script's execution "Makefile" is created which is then used to compile the package .

./configure
make

make: - This command starts compiling the application after reading the Makefile on how to install the applications binaries. This process takes the most of the time .

After doing this login to superuser mode and execute the following command to install the applications to a suitable location.

make install

make install : - This command installs the package usually in /usr/local folder.
However if for some reason the compilation does not take place successfully try reading README,INSTALL text files in the projects directory. Usually most of the projects include documentation about installing the applications in these files.


Autopackage : Autopackage is also one of the simpler ways of installing application . More can be read about it here :

www.autopackage.org

Article (C) 2006 Ambuj Varshney

For Linux On Desktop Blog




Get This Article as PDF  

Comments

  1. sathu1:43 PM

    Good Work
    It helps newbies as well us Intermediates.
    Cheers
    Sathu

    ReplyDelete
  2. Anonymous12:51 AM

    Hm, nice idea, but the article is very unbalanced:
    First of all you describe how to set up a yum system for Fedora Core 2, but you do not tell how to set up a apt-based system.
    Also (visually) you pack together dpkg and apt, but not yum and rpm.

    You completely miss Suse everywhere!

    You talk about Fedora Core 2 and fedora.us: Fedore Core 2 is obsolete for over a year now, and fedora.us completely merged into Fedora Extras. The appropriate way would have been to describe using yum in general, and then link to pages where you can pimp up the already preinstalled repositories. In your case most users will fall into the compatibility hell which happens when you mix livna, dries, fedora.us and dag.

    So, again:
    Nice idea, and you are half the way through, but:
    - avoid distribution-specific configuration, that just makes it more complicate; link to other sources for further information and more specific tuning
    - pack together which belongs together: show the "two worlds" by describing rpm+yum(/yast) and dpkg/apt
    - avoid alternatives: do not write about apt4rpm - it exists and is actively developed, but newbies should not change away from the distribution standard at the beginning (you haven't mentioned it, but just in case ;) )
    - include Suse (probably also Mandrake) with a few words - they exist, and quite a lot of newbies are taking these distributions; in fact, these are the beginners distributions!
    - talk about the graphical interfaces: we have the different interfaces, why not talk about them - almost every distribution these days has a graphical solution, show it!

    anonymous coward

    ReplyDelete
  3. Sure i have seen u r sugestions and would surely look into them and would update this article or write second part taking your suggestions into considerations.
    Thank You
    Ambuj Varshney
    For Linux On Desktop

    ReplyDelete
  4. Anonymous8:01 AM

    may i translate to Indonesian and publish it ?

    ReplyDelete
  5. Anonymous1:16 AM

    to Anonymous Coward:
    Everyone is a damn critic!
    Instead of being a lazy good-for-nothing donut head, why don't you write a tutorial that suits your needs. The tutorial presented here was not meant to be all encompassing. I guess it's easier to criticize someone else's hard work than it is to chip in and help.

    ReplyDelete
  6. artman11:27 AM

    Dear,
    I install FFMPEG on my system(Fedora) and want to do it again on other system, could I copy and past my ./usr/local directory for other system? I mean by doing this, does FFMPEG install on other system without any other work? If no, could tell me how can I doing this without any effort for client to do?

    Thanks so much for your cooperation
    (Please answer me via email artin_r99@yahoo.com)

    ReplyDelete
  7. Anonymous8:37 AM

    Thanks for quite informative compilation of different ways of installing packages - ways that I experienced recent days being Linux newbie
    (Fedora 10, Ubuntu 8.04).
    But I have this question that I even feel embarrassed to ask, as it must be
    something obvious to any seasoned Linux users:
    "And then what ?"
    Having been from MS Windows world, I would expect this newly
    installed program to show up somewhere, be it menu or desktop or...
    But it's nowhere to be found (at least most of them -as in some instances
    they do appear in menu afterward).
    So again: How to access (run) newly-installed program ?
    Thanks and sorry again :-)
    Andrew Z.

    ReplyDelete
  8. Anonymous12:26 PM

    Questions:
    1. when downloading, would it better to downloaded the source file into a newly created directory in the usr/local
    share, include etc depending on the distro?
    2. Assuming it was install successfully , how would you port it into the DESKTOP ? as an example, if bittorent is downloaded and installed, getting in to show in the INTERNET section of KDE GNOME etc is toughest job of them all
    Thank you all

    ReplyDelete
  9. Anonymous7:27 AM

    Hello,
    Thanks for this page. I couldn't install an application successfully earlier, but now it's as simple as abc...:)

    -david.

    ReplyDelete

Post a Comment

Popular posts from this blog

13 Things to do immediately after installing Ubuntu

In this article i describe some of the things to do immediately after installing ubuntu on your machine . Since most of the people reading this would be shifting from Windows to Linux with a system dual booting so i would focus more on making transition easy from Windows to Linux.

Creating Your ultimate Ubuntu 7.10 Desktop

Ubuntu 7.10 Codenamed Gusty Gibbon was released few weeks back with much fanfare ,now Ubuntu for past couple of years has been one of the most popular Desktop Linux distributions . Ubuntu 7.10 includes a number of features , applets and Wizards to simplify desktop Linux experience however because of many licensing restrictions it does not include out of the box support for popular audio/video codecs and many commercial but good applications . Also because of the limitation of trying to accommodate all kind of applications on single CD Ubuntu comes with a limited set of applications .

Now , i often have arguments with my friends who are new to computers that windows is…

Over 16 Small Games For Ubuntu Linux

Over 16 Small Games For Ubuntu Linux

Ubuntu Linux is one of the most popular Linux distribution , it is especially popular among Linux newbies and windows refuges . Now Ubuntu Linux does come with a descent set of applications , still there is a scope for including some more quality applications and especially games . Now in this tutorial i will show you how to install a large number of small , easy and less resource hungry games on Ubuntu Linux with screen-shots of games .


1. Rocks 'n' Diamonds

Rocks 'n' Diamonds is a Boulderd*sh game for X11 with more than just the falling rocks and diamonds of its namesake. The object is still to collect all the diamonds (and emeralds), then get to the exit before time runs out. But your character must make use of bombs, spaceships, and many other elements in order to fill his quota of jewels.

Installation : -

Type the following command in the terminal window

wget http://www.artsoft.org/RELEASES/unix/rocksndiamonds/rocksndiamonds-3.2…

Making Music(Beats) on Linux/Ubuntu with Hydrogen

I am going to review a couple of Music Making Softwares for Linux and am starting with the simplest and one of the best!HYDROGEN. Hydrogen basically is a pattern based drum programming software which in layman terms means, it allows you to make your own beats.And in case you aren't much into music, you might be wondering “what the hell will i do with this piece of software”...well here is a word from my friends who've tried this: “Its pretty fun playing with this software, n even without knowing much, you could actually MAKE SUM MUSIC!!!”

There was this software called Acoustica Beatcraft(for windows) which actually introduced me to this beat making stuff and I was quite interested, but sadly it was too costly for me to buy it. So i was stuck using the trial version of the software and sadly as soon as i got the grip of the software the trial expired, and so my search began for software which would do the stuff for me and luckily i found this amazing piece of software HY…