Many users face a common issue when they want to install Kali Linux or other Linux distros: the Bad Archive Mirror error. You may also face this error when trying to upgrade Kali Linux.
No worries because this article will show you what this error is, why it happens, and how you can resolve it on Kali Linux.
Let’s get started!
What is a Kali Linux Bad Archive Mirror?
Bad Archive Mirror is a common problem that occurs when you try to install Kali Linux. On a particular window, the installer asks you to choose a mirror from a list to download the components for the OS.
The mirrors depend on the country location you chose previously.
When you choose a mirror and try to proceed, the system shows you the bad archive mirror error.
Why this Error Occurs
It’s good to know the reasons that cause a bad archive mirror. It makes it easier to diagnose the problem and plans a solution.
The most possible reasons are as follows-
- You specified the incorrect mirror.
- The mirror you chose isn’t available. This can happen due to unreliable network connections.
- The mirror you chose is broken. This can be the result of an invalid Release file.
- The mirror you chose doesn’t support the correct Kali Linux version.
If you’d like to learn more about why the error occurred in your particular case, you can check out the file at /var/log/syslog.
Alternatively, you can go to Virtual Console 4. To do so, depending on your VM, press Alt+F4 or Ctrl+Alt+F4.
Now that you’re aware of the Bad Archive Mirror on Kali Linux and why it happens, let’s move on to how we can fix this issue.
Related: Best laptops for White Hat hacking
Fix 1: Don’t Use A Mirror For Installing Kali Linux
If you’re currently on the bad archive mirror window of the installer, press the Go Back button at the bottom right of the window.
The installer will tell you that no network mirror has been selected, and if you don’t choose a mirror, you will end up with only a very minimal base system.
You will be given a prompt asking whether you want to continue without a network mirror or not. From the options, choose Yes and press Continue.
This will start installing the GRUB bootloader. Continue from there until the full installation is finished.
Since you only installed a minimal version, it’s best to update your system now. To do so, open the terminal. It’s the black box icon with a dollar sign.
Type the following commands in your terminal:
sudo apt-get update
This command updates the package lists. Wait a bit till it finishes. Now type this command.
sudo apt-get upgrade
This command downloads and installs the updated packages.
Finally, reboot your device.
Fix 2: Use An Alternative Mirror
When installing Kali Linux, when you arrive at the window to choose a mirror, pick a different mirror than the one that gave you the Bad Archive Mirror problem.
Depending on your location, you should have a bunch of mirror options. Keep trying each one until you don’t receive the error.
If you got an error for every available option, proceed to the next step.
Fix 3: Change Your DNS Settings
Sometimes your router’s DNS IP may block the repositories you need to connect to in order to install Kali Linux. In such cases, you can make some small changes to your DNS settings.
To do so, press Alt+F2 or Ctrl+Alt+F2 to open a new TTY window.
Remove the configuration using this command:
Now type this command:
echo "nameserver 220.127.116.11" > /etc/resolv.conf
Lastly, use this command:
echo "nameserver 18.104.22.168" >> /etc/resolv.conf
Now check your configuration with this command:
Check if it is similar to this(contains the last two lines)
If so, you’ve successfully changed your DNS settings. Now go and try to install Kali Linux and see if the problem has been resolved or not.
Fix 4: Wrong BIOS Time
Another reason you’re getting a bad archive mirror is because your computer’s BIOS time is out of sync.
To fix your BIOS time(hardware clock), use this command below:
sudo hwclock --systohc
This changes your hardware clock to match your system clock.
Now try to install Kali Linux to see if the issue comes back or not.
Fix 5: Change The Network Connection Of The VM
The last fix we have for you is to tweak the network connection of your Virtual Machine.
Before installing Kali Linux, change your Virtual Machine’s network from NAT to Bridged Adapter.
If you’re using Oracle VirtualBox, then follow along with us. For other VM software, it’s more or less the same process.
- Turn on your VM.
- Select the OS you want to change the settings of from the left panel.
- Go to Machine → Settings
- Choose Network on the left panel.
- From the ‘Attached to’ dropdown menu, pick Bridged Adapter.
- Press Ok and close it.
The NAT setting provides a different subnet for your VM than your host computer. On the other hand, the Bridged Adapter setting makes your VM use the same network as your host computer.
In other words, your VM and host will have separate IPs with NAT, and with the Bridged Adapter, both will have the same IP.
Try to install Kali Linux and see if the problem still exists.
This article shows you everything you need to know to fix the Kali Linux bad archive mirror error many users face while installing the OS or other apps. We made sure every fix was up to date and working. These are tried and tested fixes that we hope will fix your error too.