40
Chapter 4
Using apt to Handle Software
In Debian-based Linux distributions, which include Kali and Ubuntu, the
default software manager is the Advanced Packaging Tool, or apt, whose
primary command is
apt-get
. In its simplest and most common form, you
can use
apt-get
to download and install new software packages, but you can
also update and upgrade software with it.
N O T E
Many Linux users prefer to use the
apt
command over
apt-get
. They are in many ways
similar, but
apt-get
has more functionality and I think it’s worth learning early on.
Searching for a Package
Before downloading a software package, you can check whether the pack-
age you need is available from your repository, which is a place where your
operating system stores information. The apt tool has a search function that
can check whether the package is available. The syntax is straightforward:
apt-cache search keyword
Note that we use the
apt-cache
command to search the apt cache, or the
place it stores the package names. So if you were searching for the intrusion
detection system Snort, for example, you would enter the command shown
in Listing 4-1.
kali >apt-cache search snort
fwsnort - Snort-to-iptables rule translator
ippl - IP protocols logger
--snip--
snort - flexible Network Intrusion Detection System
snort-common - flexible Network Intrusion Detection System - common files
--snip--
Listing 4-1: Searching the system with apt-cache for Snort
As you can see, numerous files have the keyword snort in them, but near
the middle of the output we see
snort – flexible Network Intrusion Detection
System
. That’s what we are looking for!
Adding Software
Now that you know the snort package exists in your repository, you can use
apt-get
to download the software.
To install a piece of software from your operating system’s default
repository in the terminal, use the
apt-get
command, followed by the key-
word
install
and then the name of the package you want to install. The
syntax looks like this:
apt-get install packagename
Adding and Removing Software
Do'stlaringiz bilan baham: |