Installing applications on Linux

Formats

Linux uses some common formats to distribute software. The most common formats for the average Ubuntu user are:

  • Debian packages(.deb)
  • Tarballs
  • Redhat packages(.rpm)

Debian packages (.deb)

Debian Packages are the most common format you will encounter when installing software in Ubuntu. This is the standard software packaging format used by Debian and Debian derivatives. All of the software in the Ubuntu repositories is packaged in this format. Synaptic Package Manager, Add/Remove Applications, Aptitude, and apt-get handle the transaction with the repository behind the scenes.

Tarballs

Tarballs are a large collection of files assembled into a single archive file. The “tar” command is used to combine many files into a single file for archiving or easy distribution. The “gzip” command is used to compress the size of a file so that it takes up less space. A tarball is very similar to a .zip file on Windows, or a .sit or .dmg file on Macs.

Tarballs have extensions like “.tar.gz”, “.tar.bz2” or “TGZ”. Most of the time, a tarball contains source files and/or binary files. In the open source community, they are used to distribute source code. If you find any software with a .tar.gz appendix, you will need to uncompress it by double clicking on it before installing the software it contains.

Source files

Source files are nothing but raw code which requires compilation to work, while binary files are like .exe files which are ready to install.

RPMs

The Red hat Package Manager or .RPM format is specifically designed for easy installation and management of software packages. The format allows you to automatically install, upgrade and remove software packages. It tracks dependencies — situations where one package requires another package in order to work correctly — and will not install software if it depends on another package which is not installed.

There are also binary files which can be directly run and they come in the format .din

INSTALLING PACKAGES

APT For Debian based distributions, like, Ubuntu, Linux Mint etc.

The APT is the tool, commonly used to install packages, remotely from the software repository. In short it’s a simple command based tool that you use to install files/softwares. Complete command is apt-get and it’s the easiest way to install files/Softwares packages. This easy tools informs you about packages that are currently being installed and also it informs you about the packages that are available in repositories.

apt-get install ${packagename}

To remove/uninstall any software, just use remove

apt-get remove ${packagename}

The software packages are somewhere in the online repositoies, APT handles a local database on the user’s hard drive that contains informations about the available packages and where they are located. So when the types the command, apt-get install conky, the APT will start finding the package named conky in the database and will install conky once user types ‘y’ (yes). To get the all newly uploaded packages on the repositories, user need to update APT regularly.

To update APT database:

apt-get update

To update the APT database and also upgrade the security updates and patches that might be available for some installed softwares, users may do it at once just by using the commands like this:

apt-get update; apt-get upgrade

And remember all of the package management tools I am discussing, will need user to be in root or superuser, for example to install software in debian based distributions you will use apt-get followed by sudo then It will ask you to enter password.

sudo apt-get install conky
sudo apt-get remove conky
sudo apt-get update

Install Software in Linux, Ubuntu, debian

Insert password to install any package

yum: For RPM based Linux distributions, like, Fedora, Red Hat

You will not have any trouble understanding yum because its same as apt-get. As ‘apt-get’ installs software packages for Debian packages, like that ‘yum’ installs software packages for RPM packages. It can also like apt-get download and install packages from a repository.

Yum install ${packagename}

To remove software packages, just use remove

yum remove ${packagename}

There is one thing to note that yum does not keep a local database by default in user’s hard disk. So there is no need to update it. But to install available security paches and bug fixes, use the following command:

yum update

If user wants to update any single package then do it in the following way:

yum update ${packagename}

Tar Balls

Tar ball files usually come in the formar .tar.gz or .tar.bz2. To install a file that comes in the above formats, firstly change the current working directory to there the package is placed using the cd command.

          cd /home/userName/path

You are not “installing” a .tar.gz file or .tar.bz2 file. .tar.gz files are gzip-compressed tarballs, compressed archives like .zip files. .bz2 files are compressed with bzip2. You can extract .tar.gz files using:

tar xzf file.tar.bz2

Similarly you can extract .tar.bz2 files with:

tar xjf file.tar.bz2

If you would like to see the files being extracted during unpacking, add v:

tar xjvf file.tar.bz2

The parameters are x to extract files, z to filter through gzip for decompression (leave this off if the file does not have a gz extension), v for verbose mode so you can tell what’s going on, f indicating there will be a filename to follow.

(If you are extracting a file named a.tar.gz, then another extracted file will be created in the same directory in a folder named a)

Further, the installation can be done by getting into the directory to the the extracted file is  placed and then type down ./configure in the terminal.

EXECUTING A .run or .bin file

.Run or .Bin files are probably the only file types you will ever need to mark as executable in normal use of Ubuntu. There are two ways to execute them (which usually installs something), either in the terminal, or graphically (which usually relies on the terminal somewhat as well). 

First, open the Terminal, then mark the file as executable with the chmod command.

        chmod +x file-name.run

Now you can execute the file in the terminal.

         ./file-name.run

If an error message including a problem such as ‘permission denied’ appears, use sudo to run it as root (admin). Be careful, sudo allows you to make critical changes to your system. Many software installs will require sudo. 

          sudo ./file-name.run

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s