Kali Linux is known as one of the best operating systems for penetration testing. It is a Debian-derived Linux distribution with a large community of users.
The OS has a rolling release model with new releases coming out approximately four times a year. Make sure to check for updates and upgrades regularly. Doing so improves the overall security and speeds up system performance.
In this article, you will learn how to update Kali Linux.
- A system running Kali Linux (it is best to install Kali as a VM)
- Access to a terminal window/command line (Ctrl+Alt+T)
- A user account with sudo or root privileges
How to Update Kali Linux?
Kali uses the Debian Package management system, which allows you to update and upgrade using the apt or apt-get command. Follow the steps outlined below to update and upgrade Kali.
Step 1: Check the Source List Files
When downloading updates using the APT package manager, ensure the system is connecting to the correct remote repository. Configuration files /etc/apt/source.list and /etc/apt/source.list.d/ contain URLs from which Kali installs packages and applications.
Open the configuration files to check the source:
The output should display the URL
deb http://http.kali.org/kali kali-rolling main contrib non-free as in the image below.
The same applies for files inside /etc/apt/source.list.d/.
Step 2: Update Package Manager
Before installing the latest software, you need to update the package repository to ensure you are downloading the newest versions. Run the following command to get the latest package lists:
Note: Kali had a default root user on versions up to 2020.1. Since more and more users started running Kali as their day-to-day operating system, they decided to move to the traditional security model of having a non-root user. The default password for the root user is toor. If you are not logged in as the root, make sure to add the Linux sudo command prefix.
Step 3: Upgrade the System
Now you can run the upgrade, which installs the latest packages and patches for Kali Linux. There are three commands you can use to upgrade Kali:
There are slight differences between them:
apt upgradecommand downloads and updates packages without deleting anything previously installed on your Kali Linux system.
apt full-upgradecommand downloads and updates packages. However, it also removes already installed packages if needed.
apt dist-upgradecommand does the same as a regular upgrade while intelligently handling changing dependencies, removing obsolete packages, and adding new ones.
Once you decide how to upgrade, type in the command and press Enter. The system will ask you to confirm the installation - type yes or y and press Enter to do so.
Note: Instead of running each command separately, you can update Kali Linux using a single command:
apt update && apt upgrade.
Step 4: Remove Unnecessary Packages
Remove obsolete packages left after the upgrade to free up disk space by running the command:
It is best to check for new updates every couple of weeks if running a default installation. After reading this article, you should know how to update and upgrade your Kali Linux system using the commands listed above.