(0 votes)

Learn how: Install your favorite software on linux Featured



Guys, we are going to learn about the Package installation in Linux systems from this article. Basically how to install a package ( a package is  simply same as a software in a windows environment) and uninstalling it, what is a repository, how to create/enable/disable a repository, how the package installation commands change with different Linux distributions and so on.

What is a Package ?

Basically a package is a software application in a Linux operating system. Same as in windows and Mac OS, in Linux also we can install a software in a GUI environment as well as with the command line interface.

What is a Package manager ?

There are different package managers for different Linux distributions. It is very important to remember how to use different package installation commands in a Linux system. As we all know in a windows OS, we have softwares ending with .exe extension. But in Linux, the extensions may be different. It can be having an extension like .rpm, .deb or whatever.  Actually the package manager is serving as tool which access the softwares and installing/removing/modifying them.

dpkg is used by Debian, Ubuntu and apt is also supported.
rpm is used by Red Hat, Cent OS and yum is also supported.


* Important – You should be a superuser to install packages. 

So, for here testing i’m taking two AWS EC2 Linux servers ( Ubuntu and a Red Hat ). We will take one by one.

To get to know which Linux distribution you are using, try the below command,

cat /etc/*-release




Yum package manager

What is yum ? Yum is a command we can use to get the packages installed in a Red Hat, Cent OS environments. Yum is using repositories to search and install the applications.

What are Repositories ?

Red Hat or third party repositories are used as the software sources. In a repo we include links where the package managers can search for the packages.

Simply a repository looks like below.




All repositories resides in the path “/etc/yum.repos.d“. The configuration file for yum is “/etc/yum.conf“.

From here, we will check the useful command we need to know.

1) yum repolist ( This command will list your active repositories )




2) yum repolist all ( This will list all of your repositories even it is enabled or disabled )




3) yum list installed ( This will list all your installed packages )

4) yum list vim* ( This will list installed and available packages which suits for package name )




5) yum search vim ( This also searches with package names )




yum search all  ( This gives more details than above )

6) yum info vim* ( This will display information about all the packages that suits the given name )

We can identify different parts in a package as below.

eg – vim-minimal.x86_64 : A minimal version of the VIM editor

vim-minimal – Package name
x86_64 – Architecture
*Sometimes we can see package version also with the names.
7) yum provides  ( This shows packages which contains the mentioned path names ). Not only path names, we can use application names also if we are not sure to check.
eg – yum provides tree



yum provides /var/www/html




8) yum install httpd ( This will install httpd package into the system )




yum install httpd -y ( This command will install the package without asking for entering yes or no at the end. )

9) yum update  ( This will update the package to the latest version. )
10) yum remove  ( This will uninstall the installed package )
11) yum list kernel ( This will display installed and available kernel software versions )




yum update kernel ( This will update the kernel to the latest version )

12) How to create a new repo
Go to the file location – /etc/repos.d
create your new repo – example.repo



[examplerepo] – repo id

Example Repolist – repo name
baseurl – source url
enabled – status of the repo ( can be enabled or disabled )




Apt package manager

Apt package manager is used in Ubuntu and Debian like Linux distributions.  Below listed commands would be helped.
apt actually works on a package database. The system will not know about is there are updates for the packages, if the package database is not updated. Because of this updating the package database is essential.
1) apt-get update ( This command will update the package database )
2) apt-get upgrade ( This will upgrade all the software to the latest version. )
3) apt-get install  ( This will install the package )
4) apt remove  ( This will remove the package binary file except configs)
5) apt purge  ( This will remove all files with the configuration files related to the package )
6) apt show  ( Display information about the package )
7) apt list  ( list the packages with the given name )
So, guys here are some of the basic very useful commands as in the above. You could know more than these commands with the usage.



Last modified on Sunday, 23 August 2020 11:51

Leave a comment