Installing Packages in Linux


Installing applications in Linux, is quite different from the way you do in Windows.
In windows all you do is,

  • Download the ‘.exe’ file of software
  • Run it, click next, accept license, click next.
  • Wait for the program to install.
  • Click exit.

This is all you have to do in Windows. But Linux does not support ‘.exe‘ files. That is probably why Linux is more secure than Windows. Now you must be wondering, If ‘.exe’ files don’t work, how will you install Applications and softwares?

Well there are many ways you to install packages in Linux. We normally call a ‘Software’ as ‘Package’ in Linux.
You can install any package in 3 ways :

  1. Using RPM (RedHat Packet Manager   – Only for RedHat based OS)
  2. YUM or APT-GET ( Yum for REDHAT based distributions and APT-GET for Debian OS ).
  3. Source installation ( ./configure, make, make install )
  • USING RPM

    – RPM stands for RedHat Packet Manager.
    – You can not only install a package usign rpm, but you can also search for a package, find place of installed package, list all the installed packages, query the package being installed, erase an existing package or upgrade any existing packages.
    – To install a package using rpm, you need to first download the ‘.rpm’ file.
    Once you have the rpm file, you can Install it using
    rpm -ivh package_name.rpm
    ‘-ivh’ stands for Install, Verbose, Hashes respectively. That is Package would be installed and the progress would be shown to you in form of ‘#’.

    Install package using rpm

    Install package using rpm

    – If you want to uninstall a package simply run
    rpm -ev packagename.rpm
    Here ‘-e’ stands for Erase.

    Uninstall package using rpm

    Uninstall package using rpm

     

    – To find list of the installed packages you can run
    rpm -qa
    it will give a very long list.
    Or to find a specific package like ‘vsftpd’
    rpm -qa | grep vsftpd

    Find a package

    Find a package

     

    – You can even upgrade a package by using
    rpm -Uvh package_name.rpm
    Here’-U’ stands for Upgrade, ‘-vh’ stands for ‘#’ verbose.

  • YUM or APT-GET

    – This is the most commonly used installation method.
    YUM stands for Yellowdog Update Manger, and is used in RedHat based OS.
    APT-GET is used in Debian based Operating Systems.

    – In YUM or APT-GET there is a Repository which consists all the available packages, which are of the latest version.
    When you run YUM or APT-GET, it goes to that repository, checks if the package is available in the repository, If its there, it will install that package along with all the dependencies. So all in all you only need to run the command.  YUM or APT-GET will do the rest. To install a package simply write yum install ‘package-name’
    yum install vsftpd‘  or  ‘apt-get install vsftpd

    Install package using YUM

    Install package using YUM

     

    – YUM or APT-GET can also be used to uninstall or upgrade any package.

    Say you want to upgrade Firefox. You’re using Firefox 16. So when you run
    yum upgrade firefox‘  or  ‘apt-get upgrade firefox‘ ,
    It will first check the current version of installed Firefox. Here it is 16.
    Then, it will go into repository and check the latest Firefox version. Suppose the latest version is 24, it will then upgrade the Firefox from 16 to 24.

    Upgrade Firefox package.

    Upgrade Firefox package.

    Upgrade details.

    Upgrade details.

     

    – We can also search for a package using YUM or APT-GET. In RPM method, you need to know the package name and download it. Here, if you want vlc, run
    yum search vlc  or  apt-get search vlc.
    If you want to search a package starting with vlc , use yum search vlc*
    If you want to search a package ending with vlc , use yum search *vlc
    If you want to search a package which has the word vlc between , use yum search *vlc*

    Search in repositories

    Search in repositories

     

    – You can also remove or uninstall a package using
    yum remove packagename‘  or  ‘apt-get erase package name

    Remove any installed package.

    Remove any installed package.

     

    – To update all the existing packages run
    yum update‘ or ‘apt-get update

    After entering yum update

    After entering yum update

    Update details.

    Update details.

     

  • Source Installation.

    – In RPM, you download the rpm file and install. RPM checks for dependencies and if they are met, it proceeds with the installation. In YUM or APT-GET, it checks for dependencies, installs them and then installs the package. But in source installation, you’ll have to do everything manually.

    – You won’t be using any application to install packages. You’ll do it by yourself.
    – You need to first download the tar ball or tar.gz file of that application.
    – This can be done in two ways. Either manually find the file on internet or use wget.
    – In wget, you just need to paste the link with wget in the beginning. Like
    – ‘wget [Download link]

    Using wget

    Using wget

    The tar.gz/tar.bz file would be downloaded in your current location.

    – Say you want to install vlc. You downloaded its tar.gz file. Now extract it using tar -zxvf
    A directory will be created with vlc name. Go into that directory.

    – Now run ‘./configure‘ . This will configure the package and create a ‘make’ file.

    Run ./configure after extracting

    Run ./configure after extracting

    Once you have the ‘make’ file, run ‘make.

    Run make after ./configure

    Run make after ./configure

     

    It will create ‘.c’ files which will be needed in the installation process.
    After make, run ‘make install‘. It will now install the files it created in the make process.

    Run make install

    Run make install

     

    – When you’re done with these 3 steps, simply write the application name in the terminal and it will run.
    Or you can refer the ‘Read me’ file.

Leave a Reply