Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix Update and Upgrade Problems in Kali Linux

When apt update or apt upgrade fails, check the repositories, the network, the keys and the disk space.

VPS and Cloud Servers2 min read3 steps4 screenshots

The three commands

  1. update refreshes the package list from the repositories:
sudo apt update
Running apt update
  1. upgrade installs newer versions of installed packages:
sudo apt upgrade
Running apt upgrade
  1. dist-upgrade (or full-upgrade) also adds and removes packages when needed. Kali needs it for many updates:
sudo apt dist-upgrade

Common problems and fixes

Wrong repository settings

Open the file:

sudo nano /etc/apt/sources.list

For Kali it should contain:

deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
The sources list file

Network problems

ping -c 4 google.com
Testing the connection

If it fails, fix your connection or DNS first.

Broken packages

sudo apt-get check
sudo apt-get install -f

GPG key errors

A message like "The following signatures couldn't be verified" means the archive key is old. Download the current key:

sudo wget https://archive.kali.org/archive-keyring.gpg -O /usr/share/keyrings/kali-archive-keyring.gpg

Not enough disk space

df -h

Free space with:

sudo apt-get clean && sudo apt-get autoremove

More troubleshooting

Use another mirror. Edit sources.list and point to another official mirror.

Install a package by hand. Download the .deb file and install it:

sudo dpkg -i package_name.deb

Best practices

  • Update often, so updates stay small.
  • Back up important data before a big upgrade.
  • Use only official Kali repositories.
  • Keep an eye on disk space.

Quick recap

  • Check sources.list, network, keys and disk space.
  • Use apt-get install -f for broken packages.
  • Update often.