Linux - Installing softwares

January 2017

Basically there are several ways to get an application running on Linux:
  • RPM packages- A file with the .rpm extension for automatic installation, for Linux distribution such as RedHat or Mandrake.
  • DEB packages- A file with the .deb extensionf or an automatic installation under Debian Linux distributions.
  • Archive files- Compressed files .tar.gz, .gz or .tar.bz2 extensions.

In the second case it is usually the software sources. So you have to compile the program on your machine first!

RPM packages

RPM (Red Hat Package Manager) is a package management tool for Linux. It allows you to install applications and delete them easily. With a single command, the files are installed directly in the "right" directories.
RPM has four additional utilities:
  • Update package: When you get a new version of the package, it is not necessary to uninstall the previous version, before installing the new one. Indeed RPM allows automatic update of packages!
  • Query: RPM allows you to view the contents of a package, but it also helps to know to which package a file belongs to.
  • System verification: RPM can check the integrity of a package (that is to say whether all the files contained the package are installed on the system).
  • Access to sources: RPM offers users a package sources and instructions for compiling in case users want to edit the files in the package.

Here are the commands of five main features:
Installation: To install the "mpg123-0_59p-1_i386.rpm" package, simply type:
  • rpm -ivh mpg123-0_59p-1_i386.rpm

If the package has already been installed before, the system will display the following message:
  • package mpg123-0_59p-1 is already installed

(The -replacepkgs option allows you to force the installation)
Removal: To remove a package, use this command:
  • rpm -e mpg123
  • (where is the mpg123 is the package name to uninstall...)

Update: To update a package, use this command:
  • rpm -Uvh mpg123-0_59p-1_i386.rpm

Query: There are several commands to query about one or more packages according to various criteria
To get details on a particular package:
  • rpm -q mpg123-0_59p-1_i386.rpm

To query on all existing packages:
  • rpm -qa

To query a package containing a particular file:
  • rpm -f NameOfFile

For information about a package:
    • rpm -p NameOfPackage

Verification: This option allows you to compare the differences between the installed package and the package as it should be. The commands are:
To check a particular file:
  • rpm -Vf NameOfFile

To check all packages:
  • rpm -Va

To check a particular package:
  • rpm -Vp NameOfPackage

When there is no error, the system displays nothing. But when errors are detected, the system returns an eight-character string indicating the type of error. The meaning of characters
  • D: Device
  • G: Group
  • L: Symbolic Link
  • M: Mode (permissions)
  • T: file date
  • S: File Size
  • U: User

DEB packages

The Debian distribution has a package management tool that automates the installation, configuration and updating of software installed through it. Debian packages are files with the .deb extension and can be installed manually using the following command.:
  • dpkg -i name_of_package.deb

In addition, a complementary system was developed to manage dependencies between packages and allow easy update: it is the apt system (Advanced Packaging Tool). The system operates from a list of sources (locations where packages are available) present in the /etc/apt/sources.list file.

Here are the commands of the main features:
Installation: To install the package "package_name" you simply type:
  • apt-get install package_name

or after manually retrieving a specific package (with the .deb extension)
dpkg --install name_of_package.deb
dpkg -i name_of_package

To force the installation of a package, use the following command:
  • apt-get install -f name_of_package

Setup simulation: it may be useful to simulate the installation of a package before installing it:
  • apt-get install -s name_of_package

Removal: To remove a package just type:
  • apt-get remove name_of_package

The above command removes the package but retains configuration files. To remove configuration files just use the following command:
  • apt-get remove --purge name_of_package

Reconfiguration: to reconfigure a package just type:
  • dpkg --reconfigure name_of_package

Updating the list: To update the list of packages, use the following command:
  • apt-get update

Updated packages: To update the packages use the following command:
  • apt-get update

It is recommended to run this command with the -u switch to get the exact list of packages that will be updated:
  • apt-get -u upgrade

The following command can also update packages better preserving dependencies to maintain a coherent system:
  • apt-get dist-upgrade

Cleaning: after every software installation, the APT system loads the related package and stores it in a local repository. After a while the list of packages stored, the total space consumed may become important and it may necessary to clean this repository. The clean command will remove all the packages that are not locked, which means that the package must be downloaded again upon reconfiguration:
  • apt-get clean

The autoclean command deletes all packages that are no longer available for download (obsolete ones):
  • apt-get autoclean

Query: There are several commands to query one or more packages according to various criteria:
For a list of packages containing a particular keyword:
  • apt-cache search keyword

For more information on a given package:
apt-cache show package_name
To view the dependencies of a package:
  • code>apt-cache depends package_name</code>

To find out which package a file belongs to:
  • apt-file search name of file

To get the list of files of a package:
  • apt-file list name_of_package

Deborphan is a software which allows you to specify the name of all the libraries that are no longer used on a debian system. These libraries are known as orphan as no more packages depend on them.
This tool is especially handy for cleaning unnecessary packets.
Finally, it should be noted that the following graphical interface simplifies the management of packages:
  • Aptitude
  • Synaptic
  • Gnome-apt
  • Wajig

Decompress archives

Most programs are available in a compressed format, that is to say in a more compact format to reduce the size, to facilitate the download.
The compressed data are available in several formats:
Tar: the files have the .tar extension.
To unpack this type of data you need to type the following command:
  • tar xvf name_of_file.tar

Gzip: the files have the .gzip extension.
To unpack this type of data you need to type the following command:
  • gunzip name_of_file.gz

Bzip2: the files have the .bz2 extension.
To unpack this type of data you need to type the following command:
  • bzip2 -d name_of_file.bz2

Tar/BZip2 (generally referred to Tarball). the files have the .tar.bz2 extension.
To unpack this type of data you need to type the following command:
  • tar jxvf nname_of_file.tar.bz2

Compress: files archived using the Compress program have the .Z extension, they can be decompressed by the Uncompress program..

Compiling the program

When the program is an archive (not an RPM) it is usually necessary to compile the sources. Although the compilation of most programs are achieved in the same way, it is strongly advised to read the INSTALL or README files!

First you must run the command:
  • ./configure

To install the application in a specific directory:
  • ./configure --prefix="directory"

Next you must compile the program using the following command:
  • make 

This command can take several minutes / hours depending on your configuration and the software to compile. In case of problems, the compilation will stop returning an error message.
After compiling the application, it is possible to install it using the following command (as root):
  • make install

In case of failure during compilation, you need to clean the makefile files created automatically during compilation before starting a new compilation. This is done using the following command:
  • make clean

Once all these steps are completed, your program should be executable!!

Original document published on


Published by jak58. Latest update on April 22, 2013 at 10:44 AM by jak58.
This document, titled "Linux - Installing softwares," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (