Kali Linux

How to Update Kali Linux

How to Update Kali Linux

Kali Linux is a powerful Linux operating system used for ethical hacking, penetration testing and other security tasks. It includes several tools that allow you to find and fix security weaknesses in your system. Updating your Kali Linux system is crucial for improving your system security and privacy. An updated system will ensure the installation of up-to-date applications that run smoothly on your system.

In this guide, you learn:

How to Update Kali Linux

On Linux systems, including Kali Linux, the packages and software are mostly installed through the default apt repository. The repository includes packages that can be installed on the system through the apt command. Once these packages are installed, they are added to the system and can be run any time. These packages are linked with the other default packages or applications installed on your system. Thus, updating the repository will automatically update these packages on the system and keep your system up to date.

To check for package (system) updates on Kali Linux, first use the following command:

sudo apt update

The above command will provide you with the information of the packages that need to be updated on the Kali Linux system.

If you want to see the packages list that need to be upgraded on Kali Linux, you can use the following command:

sudo apt list --upgradable

To upgrade the packages on Kali Linux, you should run the below-given command:

sudo apt upgrade -y

In the above-given command, the -y flag will provide approval to install the upgraded version of the packages on Kali Linux.

Besides using the upgrade command to update Kali Linux, you can also consider running the dist-upgrade command. It handles the dependencies in a more efficient way compared to upgrade command. However, the disadvantage dis-upgrade is that it removes and installs new packages that are required to resolve dependency conflicts.

sudo apt dist-upgrade -y

Apart from dist-upgrade, you can use the full-upgrade command to perform a similar action on Kali Linux, this can be done using:

sudo apt full-upgrade -y

How to Update Kali Linux from a Single Command

Besides using the update and upgrade commands individually, you can also combine them to update Kali Linux, this can be done using:

sudo apt update && sudo apt upgrade -y

How to Update a Single Package on Kali Linux

If you want to update an individual package on Kali Linux, you can use the following command by replacing the package_name:

sudo apt install --only-upgrade package_name

How to Update Kali Linux from apt-get Command

Apart from using the apt update command, you can also use apt-get update to update Kali Linux. However, it is advised to use apt command instead of apt-get because apt command not only installs packages, but it updates the dependencies as well. On the other hand, apt-get only updates the packages on the system.

How to Automatically Update Kali Linux

The unattended-upgrades is a useful command-line utility for Linux systems including Kali Linux that automate the process of updating the system. It avoids the headache of updating the system again and again using the apt update commands. You can install unattended-upgrades on Kali Linux from the following command:

sudo apt install unattended–upgrades

After installing unattended-upgrades, open the configuration file using the following command:

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Inside this file, uncomment those lines starting with // according to your choice:

Save this file using CTRL+X, add Y and press Enter to exit to the terminal.

Then open the unattended-upgrades configuration settings on Kali Linux using the below-given command:

sudo dpkg-reconfigure --priority=low unattended-upgrades

Select Yes to allow installing automatic updates on Kali Linux:

Once completed, ensure the unattended-upgrades service is running on Kali Linux, this can be done from the following command:

sudo systemctl status unattended-upgrades.service

To test unattended-upgrades is working, you can try running the below-given command:

sudo unattended-upgrades --dry-run --debug

Note: You can stop the automatic updates on Kali Linux by executing the below-given command again and select No option later on:

sudo dpkg-reconfigure --priority=low unattended-upgrades

Conclusion

Updating Kali Linux is crucial for enhancing the security of the system. You can update Kali Linux by running the update and upgrade commands. You can also update an individual package by executing the upgrade command followed by the package name you want to update. You can also install and enable unattended-upgrades on your system to automatically update your Kali Linux system. We have provided details about how to update your Kali Linux system, this will help ensure using up to date packages on the system.

Similar Posts