I followed the instructions and successfully imported the key but always get the error :
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: tor+https://deb.loki.network bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
E: Failed to fetch tor+https://deb.loki.network/dists/bookworm/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
E: Some index files failed to download. They have been ignored, or old ones used instead.
zsh: exit 100
Hey, I was having the same issue and as a Whonix newbie I had trouble trying to solve it.
Here is what finally worked for me: follow the link to deb.loki.network as per in your error and there you will find some steps.
Seems like some repositories work with rotating keys so the ones in our locals expired and they need to be replaced. In my case the solution was executing the command in the page and that immediately fixed my package update problem, hope it works for you too.
EDIT : found here https://deb.loki.network/ but issue remains even after changing the key for me… I don’t get it. Well at least I now know it’s a Session package issue.
Get:10 tor+https://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease [12.9 kB]
Get:11 tor+https://deb.loki.network bookworm InRelease [4705 B]
Err:11 tor+https://deb.loki.network bookworm InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
Reading package lists... Done
E: Release file for tor+https://deb.debian.org/debian/dists/bookworm-updates/InRelease is not valid yet (invalid for another 1d 16h 10min 4s). Updates for this repository will not be applied.
E: Release file for tor+https://deb.debian.org/debian-security/dists/bookworm-security/InRelease is not valid yet (invalid for another 1d 10h 47min 50s). Updates for this repository will not be applied.
E: Release file for tor+https://deb.debian.org/debian/dists/bookworm-backports/InRelease is not valid yet (invalid for another 1d 16h 10min 3s). Updates for this repository will not be applied.
E: Release file for tor+https://fasttrack.debian.net/debian-fasttrack/dists/bookworm-fasttrack/InRelease is not valid yet (invalid for another 1d 21h 2min 8s). Updates for this repository will not be applied.
E: Release file for tor+https://fasttrack.debian.net/debian-fasttrack/dists/bookworm-backports-staging/InRelease is not valid yet (invalid for another 1d 21h 2min 8s). Updates for this repository will not be applied.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: tor+https://deb.loki.network bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
zsh: exit 100 sudo apt update
Update on the situation. I was able set my time correctly bur error with session key remains
Err:4 tor+https://deb.loki.network bookworm InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
my session.sources looks like following
Types: deb
URIs: https://deb.session.foundation
Suites: bookworm
Components: main
Signed-By: /usr/share/keyrings/session-foundation.gpg
I am going crazy with this !
As it is not related to Whonix I guess I should contact :
Contact jagerman via via @jagerman42 (Telegram) or jagerman (on Session).
cat <<EOF | sudo tee /etc/apt/sources.list.d/session.sources
Types: deb
URIs: https://deb.session.foundation
Suites: $(lsb_release -sc)
Components: main
Signed-By: /usr/share/keyrings/session-foundation.gpg
EOF
sudo apt update
[sudo] password for user:
Types: deb
URIs: https://deb.session.foundation
Suites: bookworm
Components: main
Signed-By: /usr/share/keyrings/session-foundation.gpg
Get:1 tor+https://updates.signal.org/desktop/apt xenial InRelease [5955 B]
Get:2 tor+https://updates.signal.org/desktop/apt xenial/main amd64 Packages [89.2 kB]
Hit:3 tor+https://deb.kicksecure.com bookworm InRelease
Get:4 tor+https://fasttrack.debian.net/debian-fasttrack bookworm-fasttrack InRelease [12.9 kB]
Hit:5 tor+https://deb.whonix.org bookworm InRelease
Get:6 tor+https://deb.loki.network bookworm InRelease [4705 B]
Hit:7 https://deb.session.foundation bookworm InRelease
Err:6 tor+https://deb.loki.network bookworm InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
Get:8 tor+https://fasttrack.debian.net/debian-fasttrack bookworm-backports-staging InRelease [12.9 kB]
Hit:9 tor+https://deb.debian.org/debian bookworm InRelease
Get:10 tor+https://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:11 tor+https://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:12 tor+https://deb.debian.org/debian bookworm-backports InRelease [59.4 kB]
Get:13 tor+https://deb.debian.org/debian-security bookworm-security/main amd64 Packages [293 kB]
Get:14 tor+https://deb.debian.org/debian bookworm-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:15 tor+https://deb.debian.org/debian bookworm-backports/main amd64 Packages T-2026-03-02-2002.42-F-2026-03-02-2002.42.pdiff [888 B]
Get:15 tor+https://deb.debian.org/debian bookworm-backports/main amd64 Packages T-2026-03-02-2002.42-F-2026-03-02-2002.42.pdiff [888 B]
Fetched 646 kB in 6s (108 kB/s)
Reading package lists… Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: tor+https://deb.loki.network bookworm InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
E: Failed to fetch tor+https://deb.loki.network/dists/bookworm/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 401E790E060BB00E
E: Some index files failed to download. They have been ignored, or old ones used instead.
zsh: exit 100 sudo apt update
[workstation user ~]% curl -so /usr/share/keyrings/session-foundation.gpg https://deb.session.foundation/pub.gpg
cat </etc/apt/sources.list.d/session.sources
Types: deb
URIs: https://deb.session.foundation
Suites: $(lsb_release -sc)
Components: main
Signed-By: /usr/share/keyrings/session-foundation.gpg
EOF
apt update
zsh: exit 23 curl -so /usr/share/keyrings/session-foundation.gpg
zsh: permission denied: /etc/apt/sources.list.d/session.sources
zsh: exit 1 cat <<<“” > /etc/apt/sources.list.d/session.sources
Reading package lists… Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
zsh: exit 100 apt update
[workstation user ~]%
Still not able to make the changes I am still using Whonix 17
And solved with the help of jagerman. I had to delete the old “loki.list” file in the folder /etc/apt/sources.list.d/ and only keep the new one I edited.