Kali Linux one of the best Linux distro for penetration testing it’s frequently updated
so we must know How to update Kali Linux, Most of the updates are not by Kali Linux team, most of them are by the programmers how made the great tools you can find in Kali Linux.
you should always update Kali Linux to keep the tools operational.
This short tutorial will show you the commands you need to update the tools and system.
What you will learn in this tutorial is
- how to update Kali Linux
- how to fix update errors
- how to update Kali Linux on a network that has a proxy
First you may check this video
How to update Kali Linux
Kali Linux Updating process
- apt-get update: address update, update software source data.
- apt-get upgrade: software update, update all installed software.
- apt-get dist-upgrade: system update, replace the system version.
- apt-get clean: Clean up garbage, delete all downloaded packages.
So before we start First make sure you are using the Official repositories for Kali Linux.
The first step is to install the correct official Kali Linux repositories.
Make sure your /etc/apt/sources.list contains the following official Kali repositories:
deb https : // http.kali.org/kali kali-rolling main non-free contrib deb - src https : // http.kali.org/kali kali-rolling main non-free contrib
How to update kali linux
Step One: Start Kali Linux and open a terminal.
Step Two: Type the update commands in the terminal and hit Enter Now everything should work fine and the update will start.
apt-get update && apt-get upgrade
But what if you got some errors?
Fix kali linux update error
when you try to update you may face a lot of errors we will try to sort some of the most known errors, so let’s start with the first error:
Fix kali Linux failed to fetch
Err:1 http://http.kali.org/kali kali-rolling InRelease Connection failed [IP: 126.96.36.199 80] Reading package lists... Done W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Connection failed [IP: 188.8.131.52 80] W: Some index files failed to download. They have been ignored, or old ones used instead.
The simplest fix is to replace the existing HTTP protocol with the secure HTTPS protocol.
change to the relevant /etc/apt/sources.list repositories located within /etc/apt/sources.list:
FROM: deb http://http.kali.org/kali kali-rolling main non-free contrib TO: deb https://http.kali.org/kali kali-rolling main non-free contrib
Then try sudo apt-get update
Still not working? Please make sure your sources.list file is set up correctly follow this tutorial for that How to update kali linux repository
Reading package lists done
I tried to update using apt-get update but nothing really happens see the image
if this is the case with you then you must Edit your sources.list : please Follow this tutorial for that How to update kali linux repository
Kali Linux update Signatures were invalid
When I try to apt-get update it says:
Get:1 http://archive-3.kali.org/kali kali-rolling InRelease [30.5 kB] Err:1 http://archive-3.kali.org/kali kali-rolling InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <email@example.com> Reading package lists... Done W: GPG error: http://archive-3.kali.org/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <firstname.lastname@example.org> E: The repository 'http://http.kali.org/kali kali-rolling InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
if this is the case with you it means your keys are outdated; you need to first update your keys. Try:
wget -q -O - archive.kali.org/archive-key.asc | apt-key
why does this happen? If you don’t update Kali regularly, your archive-keyring package will be outdated, and you’ll get key mismatches when working with Kali Linux repositories. that’s why you need to manually update the new key
update kali linux command
now some more commands that must fix kali linux update to try:
apt-get clean && apt-get update && apt-get dist-upgrade
Still having the problem ? maybe some package is missing ? try this
apt-get update --fix-missing
apt-get update && apt-get upgrade
So after all its not working?
Maybe you have a proxy in your network? So here is the fix that
Update behind proxy
Type in terminal:
sudo apt-get install proxychains
add proxy to /etc/proxychains.conf then
proxychains apt-get update && apt-get upgrade
I hope its working now and you got your system updated but if not then leave a comment with details about the error.
What may cause kali Linux update errors?
It is found that many beginners who use kali Linux paste many open sources into their etc/apt sources.list files when configuring mirror sources. In fact, every time they update, there will be unsuccessful updates.
I suggest you choose an update source when you need it only.
Possible problem one:
0% waiting for the header-it has been stuck in this place, it is likely to be a network problem (mine is not stable on the campus network), the solution is to add # comments in front of deb in the official source, and then execute apt-get update, The update will be completed directly, then remove the # in front of deb, and execute apt-get update again to get the header.
Possible problem tow:
An error hash checksum does not match-after observation, the checksum does not match are all .gz format files, so in the /etc/apt.conf.d/00aptitude file, (if you do not have this file, please build your own) Add the following to the last line of
Acquire :: CompressionTypes :: Order “gz” ;
(don’t miss the semicolon)
Then re apt-get update
Possible problems three:
After apt-get update, some errors will still appear after executing apt-get upgrade. Then please repeat apt-get update and apt-get upgrade until 100% start loading and configuration files (it will take a long time).
Kali Linux update explanation
Kali Linux is based on Debian , as is Ubuntu . Thus, Ubuntu and Kali Linux use the Debian package management system.
The apt command is used to install, uninstall, update packages, i.e., software on your system. This is why it is called the package manager.
Now you see two commands: update and upgrade. This can be confusing. If there is an update command that should update the system, then why is the upgrade command used?
Let us explain this to you.
This command updates the list of repositories on your system. Thus, your system checks if a new package is available from Kali Linux servers or if a new version is available.
The apt update command does not install a new package or update an existing package. She just gets information about the packages.
This command actually updates your system. When you run the apt update command, your system knows which packages the update is available for. When you run the apt upgrade command, your system will start downloading updates to these packages and, therefore, will update their version.
Now you know the difference between apt update and apt upgrade.
apt update && apt upgrade -y
Using &&, we combined the two teams into one. Thus, the second command (apt upgrade -y) starts automatically after the successful completion of the first command.
You may ask why we used the -y option in the apt upgrade -y command? This is because we wanted to save some of your time.
You see, when you run the apt upgrade command, it asks for your confirmation before installing these updates. it’s waiting for your input. You will need to type yes, y or just press Enter.
If you specify -y when running the apt upgrade command, it will automatically select y, so you do not have to enter y manually and your system will not wait for your confirmation, and you will save some time.
You may check this Video how to update Kali Linux and fix kali sources.list Repositories
We hope this little short article not only helped you learn how to update Kali Linux, but you also learned a few things about it.
Make sure to check :