Day 45 - Instaling, Updating, Removing Software In Linux

This is the fourtheenth post in the Linux Series and in this I will try to explain how to install and remove softwares and some common functions related to it in the Linux OS.

There comes a time when you need a software to do a task that preinstalled software on the OS is not capable of. For this you have to find and install a new software to complete the work. In Linux you can directly install software from the command line using the Advanced Packaging Tool or apt which comes pre-installed with the Linux.

Before installing the software you have to check if your OS repository have the required software and to do that we use apt-cache command.

root@User:~$ apt-cache search package

Adding Softwares and Pacakges

After checking that if the software is in the repo, you can use apt-get command followed by install keyword and the name of the software to download and install the software.

root@User:~$ apt-get install nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
zenmap
The following NEW packages will be installed:
nmap
Install these pacakages without verifivation [Y/n]?
# Downloading and Installing nmap

Updating and Upgrading Software and Packages

These software are updated day by day and often contains some changes that are needed to better secure your OS. So you must periodically update your local softwares and to do that just type update infront of the apt-get command.

root@User:~$ apt-get update
# Updating all necessary Softwares
# and packages

The same goes for Upgrading softwares. The newer versions of the sotware are built contain more features and are better at protecting the OS and the system. To upgrade your software, use upgrade keyword instead of update.

root@User:~$ apt-get upgrade
# Upgrades all out-of-date
# softwares and pacakges

Removing Softwares and Packages

The same command is alos used to remove softwares and pacakages from the system. Use apt-get followed by remove and the name of the package to remove.

root@User:~$ apt-get remove nmap

After that it will print some info and ask for permission to remove the software.

If you want to delete the whole package as well as the configuration files and other settings related files you can use the purge keyword instead of the remove.

root@User:~$ apt-get purge nmap

zainscizainsci