Unable to update kali template

Hi. I haven’t been able to update the kali template. This is what I get. I’m running an up-to-date Qubes OS 4.1. Update is via whonix. I downloaded and installed a kali template a week ago. Assistance is appreciated. Thank you.

Hit:1 https://deb.qubes-os.org/r4.1/vm bullseye InRelease                      
Hit:2 https://deb.debian.org/debian bullseye InRelease              
Get:4 https://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Err:3 http://kali.download/kali kali-rolling InRelease
  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
Fetched 79.0 kB in 6s (14.0 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
30 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://kali.download/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  graphicsmagick libgraphicsmagick-q16-3
The following packages will be upgraded:
  libqrexec-utils2 libqubes-rpc-filecopy2 libqubesdb libvchan-xen
  pulseaudio-qubes python3-qubesdb python3-qubesimgconverter qubes-core-agent
  qubes-core-agent-dom0-updates qubes-core-agent-nautilus
  qubes-core-agent-network-manager qubes-core-agent-networking
  qubes-core-agent-passwordless-root qubes-core-qrexec qubes-gpg-split
  qubes-gui-agent qubes-img-converter qubes-input-proxy-sender
  qubes-kernel-vm-support qubes-mgmt-salt-vm-connector qubes-pdf-converter
  qubes-usb-proxy qubes-utils qubes-vm-dependencies qubesdb qubesdb-vm
  xen-utils-guest xserver-xorg-input-qubes xserver-xorg-qubes-common
  xserver-xorg-video-dummyqbs
The following packages will be DOWNGRADED:
  gir1.2-polkit-1.0 libpolkit-agent-1-0 libpolkit-gobject-1-0 policykit-1
  python3-xcffib
30 upgraded, 2 newly installed, 5 downgraded, 0 to remove and 0 not upgraded.
Need to get 2,371 kB/3,157 kB of archives.
After this operation, 8,900 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://http.kali.org/kali kali-rolling/main amd64 gir1.2-polkit-1.0 amd64 0.105-30+kali2
  404  Not Found [IP: 127.0.0.1 8082]
Err:2 http://http.kali.org/kali kali-rolling/main amd64 policykit-1 amd64 0.105-30+kali2
  404  Not Found [IP: 127.0.0.1 8082]
Err:3 http://http.kali.org/kali kali-rolling/main amd64 libpolkit-agent-1-0 amd64 0.105-30+kali2
  404  Not Found [IP: 127.0.0.1 8082]
Err:4 http://http.kali.org/kali kali-rolling/main amd64 libpolkit-gobject-1-0 amd64 0.105-30+kali2
  404  Not Found [IP: 127.0.0.1 8082]
Err:5 http://http.kali.org/kali kali-rolling/main amd64 libgraphicsmagick-q16-3 amd64 1.4+really1.3.36+hg16481-1
  404  Not Found [IP: 127.0.0.1 8082]
Err:6 http://http.kali.org/kali kali-rolling/main amd64 graphicsmagick amd64 1.4+really1.3.36+hg16481-1
  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/p/policykit-1/gir1.2-polkit-1.0_0.105-30+kali2_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/p/policykit-1/policykit-1_0.105-30+kali2_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/p/policykit-1/libpolkit-agent-1-0_0.105-30+kali2_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/p/policykit-1/libpolkit-gobject-1-0_0.105-30+kali2_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/g/graphicsmagick/libgraphicsmagick-q16-3_1.4+really1.3.36+hg16481-1_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/g/graphicsmagick/graphicsmagick_1.4+really1.3.36+hg16481-1_amd64.deb  404  Not Found [IP: 127.0.0.1 8082]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

good luck

pd: It’s not a qubes-os issue but a push is always good.

Thank you for message. I had duckduckgoed the log files and found the same pages as in the search you did. But I don’t understand how 2 to 5 year old solutions exist for this problem? Does this mean that Kali is broken somewhere? Why was it not fixed?

This is why I reached out on this forum, just in case the problem was Qubes, or Qubes community Kali, specific.

Practically, I followed the instructions I found on stackexchange. I still couldn’t fix the problem.

I couldn’t run this command because I couldn’t figure out how to proxy gpg to make it work in a template:

gpg --keyserver keyserver.ubuntu.com --recv-key 7D8D0BF6

This is the attempt to add gpg key from another source:

$ sudo wget --proxy http://127.0.0.1:8082 https://archive.kali.org/archive-key.asc
–2023-02-17 08:58:07-- http://127.0.0.1:8082/
Connecting to 127.0.0.1:8082… connected.
HTTP request sent, awaiting response… 403 Filtered
2023-02-17 08:58:07 ERROR 403: Filtered.

–2023-02-17 08:58:07-- https://archive.kali.org/archive-key.asc
Resolving archive.kali.org (archive.kali.org)… failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘archive.kali.org

Attempt to install kali-archive-keyring

$ sudo apt install kali-archive-keyring
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following NEW packages will be installed:
kali-archive-keyring
0 upgraded, 1 newly installed, 0 to remove and 35 not upgraded.
Need to get 6,564 B of archives.
After this operation, 16.4 kB of additional disk space will be used.
Err:1 Index of / kali-rolling/main amd64 kali-archive-keyring all 2020.2
404 Not Found [IP: 127.0.0.1 8082]
E: Failed to fetch http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2020.2_all.deb 404 Not Found [IP: 127.0.0.1 8082]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

O’rly? Then why are you trying to install a three year old keyring for a rolling distro as opposed to this one?

Excuse my ignorance, but would you know why Kali template did not install with this keyring? And I am not someone who has studied IT.

So I installed kali-archive-keyring_2022.1_all.deb as per @cayce recommendations.
I was able to update Kali.
Then I had a list of packages that still needed to install, so I ran “apt full-upgrade”.
And now I cannot get Kali to start. It tells me every time that it “Cannot connect to qrexec for 60 seconds”. These are the last lines of the Dom0 kali log file, after one more re-attempt just now to get Kali template to run.
Can this be fixed? Is the problem in the “localhost login:”?

[2023-02-18 15:50:36] [.[0;32m  OK  .[0m] Finished .[0;1;39msystemd-update-ut… - Record Runlevel Change in UTMP.
[2023-02-18 15:50:36] [.[0;32m  OK  .[0m] Finished .[0;1;39mphpsessionclean.s…ice.[0m - Clean php session files.
[2023-02-18 15:50:36] [.[0;32m  OK  .[0m] Started .[0;1;39mtor@default.servic…onymizing overlay network for TCP.
[2023-02-18 15:50:36] [    7.371618] fbcon: Taking over console
[2023-02-18 15:50:37] ^M
[2023-02-18 15:50:37] Kali GNU/Linux Rolling localhost hvc0
[2023-02-18 15:50:37]
[2023-02-18 15:50:37] localhost login:
1 Like

Just guessing but, it may be that your apt full-upgrade was done in haste and output wasn’t read. Output that said, “qubes-core-exec” will be REMOVED.

To avoid this, can try:

apt-mark hold qubes-core-exec qubes-core-agent

(or whatever else wanting to hold), before upgrade?


More info on updating rolling can be found here at, Rolling distros - Parrot, Arch, Kali.

Thank you, @cayce. In retrospect, I should have only pursued sudo apt update && sudo apt upgrade and should not have done sudo apt full-upgrade. I guess full-upgrade included packages on hold. I will re-attempt install and update.

It did not.
apt-mark hold will prevent a package from being upgraded, installed or
removed.
apt full-upgrade would not over ride this.
Look elsewhere for the explanation.

I think the Kali key was regenerated in January, after the template was
built but before you attempted update.
Keys are often published with a “life span” like this: it helps to limit
damage that might be caused by an undiscovered key compromise.

I had the same issue with my kali template and sorted it by getting the new signing key from the ubuntu keyserver above (expires 2025) then following this guide:

(under: You need to know why apt-key add is deprecated)

The article is worth reading anyway. Although none of this is really Qubes specific, sorry.