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.
* 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,
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
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. )
yum update kernel ( This will update the kernel to the latest version )
[examplerepo] – repo id
Apt package manager