Learning Hub / Your Attack Machine / Update & Upgrade

Update & Upgrade Kali

Guide 2.2 Difficulty: Beginner ~15 minutes (plus download time)

A fresh Kali image is often weeks or months old. Updating ensures your tools, libraries, and security patches are current. Because our lab is isolated, we'll briefly give Kali internet access, update, then take it offline again.

Step 1 — Temporarily enable internet access

Shut Kali down, then in VirtualBox open Settings → Network → Adapter 2, tick Enable Network Adapter, and set Attached to: NAT. Boot Kali and confirm it can reach the internet:

kali@kali
$ ping -c2 kali.org
64 bytes from kali.org: icmp_seq=1 ttl=54 time=14.2 ms

This is the only machine we connect to the internet, and only temporarily. We'll disable Adapter 2 again once updates finish.

Step 2 — Refresh the package lists

apt update downloads the latest list of available packages. It does not install anything yet.

kali@kali
$ sudo apt update

Signing-key error? Older images may report "The following signatures were invalid". Kali rotates its repository key periodically. Fix it by installing the current keyring, then update again:

fix the Kali key
$ sudo wget https://archive.kali.org/archive-keyring.gpg -O /usr/share/keyrings/kali-archive-keyring.gpg
$ sudo apt update

Step 3 — Perform the full upgrade

Upgrade every installed package. On Kali, full-upgrade is preferred because it will add or remove dependencies as needed.

kali@kali
$ sudo apt full-upgrade -y

This can take a while on first run as it may download hundreds of megabytes. Let it finish, accepting any prompts (the defaults are safe).

Kali terminal running sudo apt full-upgrade and downloading packages
Figure 1. apt full-upgrade bringing Kali up to date.

Step 4 — Clean up

Remove packages that are no longer needed and clear the local download cache to reclaim disk space.

kali@kali
$ sudo apt autoremove -y
$ sudo apt clean

Step 5 — Reboot and go back offline

If the kernel was upgraded, reboot so the new one loads:

kali@kali
$ sudo reboot

Then shut down and disable Adapter 2 (NAT) again so Kali is back on the isolated network only.

Make it a habit. Re-run sudo apt update && sudo apt full-upgrade -y every couple of weeks (with internet temporarily enabled) to stay current.

Checkpoint: Kali is fully upgraded, cleaned up, rebooted, and back on the isolated network. Next we'll configure it for comfortable daily use.