Installing Applications Under Linux
Installing rpm packages on Redhat,Fedora Based Systems : - For Fedora based systems rpm is the standard format for packages ,
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
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 :-
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
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
For archives starting with .tar.bz2 use bunzip2 filename
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
Good Work
ReplyDeleteIt helps newbies as well us Intermediates.
Cheers
Sathu
Hm, nice idea, but the article is very unbalanced:
ReplyDeleteFirst 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
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.
ReplyDeleteThank You
Ambuj Varshney
For Linux On Desktop
may i translate to Indonesian and publish it ?
ReplyDeleteto Anonymous Coward:
ReplyDeleteEveryone 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.
Dear,
ReplyDeleteI 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)
Thanks for quite informative compilation of different ways of installing packages - ways that I experienced recent days being Linux newbie
ReplyDelete(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.
Questions:
ReplyDelete1. 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
Hello,
ReplyDeleteThanks for this page. I couldn't install an application successfully earlier, but now it's as simple as abc...:)
-david.