Table of Contents
Introduction - Install DEB package on Kali Linux
There are two ways you can use to install software on your Kali Linux system. You can use the Terminal method, where you will use the apt package manager or other distribution-independent package platforms like Snap, AppImage, and FlatPak. The other way is downloading the installer file (usually the .deb file) and installing it on your system.
Installing Deb files on Debian-based distributions like Ubuntu and Debian distribution can be easy since these operating systems come with the software centre. The software centre is a utility where users can find, download and install software graphically. When you have a .deb file, you will right-click on the file and select the option "install with software centre. "Unfortunately, Kali Linux doesn't have the software centre installed by default, and you will have to install the .deb file using the Terminal. Luckily, it's not hard as you would think.
This post will give you a detailed guide to installing .deb files on Kali Linux. Let's dive in.
Method-1: Install DEB package with DPKG
DPKG is a command-line tool used to install, build, remove and manage Debian packages on Linux systems. It comes with various options, which you can view by running the command:
To install a package with dpkg, launch the Terminal and use the
cd command to navigate to the file's location and install it with the syntax below.
In our case, we will install the
cd Downloads sudo dpkg -i vscode.deb sudo apt install -f
You will notice that we have an additional command
sudo apt install -f.
That's because when you use dpkg to install a package on Linux, it will check your system for all the dependencies required to install and run the software. If even a single dependency is not satisfied (which is the case most of the time), the package is left in an "unconfigured" state and considered broken.
apt install -f command tries to install any of the missing dependencies. When you read the apt man page, you will see the
-f parameter stands for
-f, --fix-broken Fix; attempt to correct a system with broken dependencies in place.
Method-2: Install DEB package With DPKG
Alternatively, you can avoid any dependency errors by first checking for the dependencies required by the package and install them first; You can do so by executing the command below.
sudo dpkg -I vscode.deb
That will list all the dependencies required to install the
vscode.deb file. You can now install these dependencies using the
apt command shown below:
sudo apt-get install [dependency] name
After installing all the required dependencies, proceed to install the deb file with the command below.
sudo dpkg -i vscode.deb
Method-3: Install DEB Files With APT Package Manager
Other than DPKG, you can also use the apt command to install deb files on your Kali Linux system. However, this method works in every unique way and requires one to have an active internet connection. That's because apt first makes a list of all the required dependencies and installs them from the repository. When done, it calls the
dpkg utility and uses it to install the file. Therefore, the
apt method uses
dpkg under the hood.
To install a package with apt, launch the Terminal and use the cd command to the file's directory and use the syntax below to install the file.
cd Downloads sudo apt install ./vscode.deb
Method-4: Install DEB Files With GDEBI
GDEBI is a command-line utility that enables you to install deb files smoothly by proper handling of dependencies. We say "smooth installation" because dpkg can be pretty aggressive at times when installing specific packages.
For example, when I tried installing the skype deb file with dpkg, it attempted to remove 96 packages, including system libraries necessary for running other tools and software. GDEBI works similarly to the apt command. It will first install all the required dependencies before installing the deb package.
GDEBI does not come pre-installed in Kali Linux. To install it, use the command below:
sudo apt install gdebi-core
Once done, proceed to install the deb package with the syntax below.
cd Downloads sudo gdebi vscode.deb
That's it! I believe you now have three ways you can use to install a deb file on your Kali Linux system. If you have an active internet connection, I highly advise you to use the
apt install ./<package_name> method or gdebi. However, if you don't have internet access, use the
dpkg -i command, which does not install any required libraries. But if you encounter any error, you will need to run
apt install -f to install any missing dependencies, which requires internet access. Feel free to hit the comments below in case you come across any challenges.