One of the most fundamental tasks in Linux or–for that matter–any operating system, is adding and removing software. We often need to install software that did not come with our distribution or remove unwanted software. In Debian (of which Kali and Ubuntu belong to), the software package manager is aptitude. Within aptitude, the primary command is apt-get to download and install new software.
In this tutorial, we will examine the aptitude package manager and couple other key ways of adding new software.
Adding and Removing Software
Probably the most common command for installing software on Debian systems is apt-get. In its simplest and most common form, it is used to download and install new software packages, such as;
kali > apt-get install snort
When removing software, we use the remove option with apt-get such as;
kali > apt-get remove snort
The remove command does not remove the configuration files so that you can re-install the same package in the future without re-configuring.
If you want to remove the package AND all its configuration files, you can use the purge option like below;
kali > apt-get purge snort
Updating and Upgrading
Periodically, the software repositories are updated, but your individual system will not be updated until you command it to do so. We can type;
kali > apt-get update
This will go to the repositories that are listed in your sources.list (see below) file and update the your package lists
apt-get upgrade
To upgrade the operating system, you can use apt-get upgrade. In this case, you must be logged in as root or use the sudo command before the apt-get upgrade. This command will go out and upgrade your entire operating system. This can be time consuming, so make certain you will not be needing your system for awhile.
kali > sudo apt-get upgrade
sources.list
There are many repositories in the Linux world. Nearly every distribution has its own repositories of software. This means that Debian has a repository, Ubuntu has a repository, Red Hat has a repository, etc. Although these repositories often contain the same or similar software, they are not identical. each repository has software developed and configured for that distribution and may not work with other distributions.
Sometimes they have different versions and sometimes entirely different software. In our case, we are using the Kali repository.
The Kali repository has a large number of security and hacking software, but sometimes does not include specialty software and tools or even some run-of-the-mill software, as it tends to specialize in security and hacking software.
We can open the sources.list file with any text editor. In this case, I will use leafpad.
kali > leafpad /etc/apt/sources.list
The repositories listed in the sources.list are the ones that your system accesses for software packages.
Many of the Linux distributions divide the repositories into separate categories. For instance, Ubuntu breaks out its repository categories into the following;
* main – supported open-source software
* universe – community-maintained open-source software
* multiverse – software restricted by copyright pr other legal issues
* restricted – proprietary device drivers
* backports – packages from later releases
It is NOT recommended that you use testing, experimental or unstable repositories in your sources.list.
I often will add other repositories, just in case the Kali repository does not have the software I’m looking for. For instance, I often add the Ubuntu repositories after the Kali repositories in my sources.list. In this way, when I want to download a new software package, it will first look in the Kali repository and if it is not there, then look in the Ubuntu repository or other repositories listed after the Kali repository. The system looks sequentially through your repositories listed in sources.list and stops when it finds the desired package.
GUI-based
In addition to the command line tools to download and install new software, Kali and other versions of Linux with a GUI most often have a GUI-based tool for installing and removing software. In Kali 1.1, we can go to Applications –>System Tools –Add/Remove Software as seen below.
When you click on it, it opens a window like that below. From here , you can search for software and other packages and install or remove them from your system.
git
In some cases, the software you want or need is not available in ANY of the repositories. Often, when a new tool is developed, it is first available on github.com. For instance, in my series on SCADA hacking, we used a tool specifically designed for scanning and hacking the modbus protocol, often found in these SCADA systems. It is NOT available through the Kali, Debian or Ubuntu repository, but it is available on github.com.
To install it, we simply used the git clone command followed by the URL of the software such as;
kali > git clone https://github.com/enddo/smod
git clone then copies all the data and files from that location.
There many ways to download and install new software on your Linux system and these three are critical. Keep coming back my aspiring hackers as we explore the wonderful world of Linux for Hackers!