I just installed Kali NetHunter and I'm trying to do a simple apt update but it looks like a public key is missing

root@kali:~# apt-get update
 0% [Waiting for headers] [Connected to packages.microsoft.com (13.8Get:2 https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch InRelease [3232 B]
 Hit:1 http://kali.download/kali kali-rolling InRelease
 Err:2 https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch InRelease
   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
 Reading package lists... Done
 W: GPG error: https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
 E: The repository 'https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch 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.

I tried

curl -s https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/dists/stretch/Release.gpg | apt-key add -


wget --no-check-certificate https://packages.microsoft.com/repos/microsoft-debian-stretch-prod/dists/stretch/Release.gpg | apt-key add -

And the result was gpg: no valid OpenPGP data found for both

  • 2
    Has Kali changed their policy regarding 3rd-party repositories? Last I knew, they only wanted kali.org in the sources.list... – Jeff Schaller May 31 at 21:59
  • 1
    Same pubkey error: unix.stackexchange.com/a/479137/117549 – Jeff Schaller May 31 at 22:00
  • There's nothing else than the kali repo in the sources.list but I found a microsoft.list inside /etc/apt/sources.list.d/ And I don't think it's the same problem since even curl -s https://packages.microsoft.com/keys/microsoft.asc |apt-key add - give me the same result gpg: no valid OpenPGP data found – Yox Jun 1 at 15:26
  • @JeffSchaller You are correct: "Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL." – Sparhawk Jun 11 at 0:23

The workaround solution I found is to delete /etc/apt/sources.list.d/microsoft.list and to make sure the kali repo is uncommented and is inside the main /etc/apt/sources.list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.