Linux Tutorial | apt-get

You installed Linux (Debian) and now you want to install other programs. If you’re coming from Windows you’re used to downloading a file, clicking on it and pressing OK a few times to install a new program. It doesn’t quite work that way on Linux.

In Linux you will use apt-get to download, install, update and remove programs. So without further adieu….

In this example I am using NMAP. Depending on what version of Linux you are on NMAP may already be installed in which case the above instruction will attempt to update NMAP.

Now you may have also gotten an error along the lines of you not have administrative privileges. If that’s the case then do the following:

You will be prompted for your password. Once you supply the correct password NMAP will download and install.

What if you just need to update it?

This will update all of your installed programs. Here’s a few more apt-get commands.

The above will remove .deb packages for programs that are no longer installed on your system.

This command will do the same as autoclean except it will also remove all cached packages as well, which can take some time if you have a slow internet connection.

This command will remove NMAP from your system but will leave behind the configuration files.

This command will remove nmap from your system and will not leave behind the configuration files.

This removes packages that were installed by other packages and are no longer needed.

Now this does not cover everything that you can do with apt-get. For full instructions on the usage of apt-get do the following:

This will display the manual for apt-get. Now here’s a video I put together on how to install NMAP on Ubuntu, and then run a simple scan using NMAP in Kali.