2

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 -

and

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

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Yox
  • 131
  • 1
  • 1
  • 5
  • 3
    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 '19 at 21:59
  • 1
    Same pubkey error: https://unix.stackexchange.com/a/479137/117549 – Jeff Schaller May 31 '19 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 01 '19 at 15:26
  • @JeffSchaller You [are correct](https://docs.kali.org/general-use/kali-linux-sources-list-repositories): "Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL." – Sparhawk Jun 11 '19 at 00:23

4 Answers4

3

load the key from microsoft

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
U.V.
  • 261
  • 2
  • 6
  • This was the first thing I tried after encountering an error when installing the mono-project repo in Ubuntu 20.10, and apparently it was all that was necessary. Thanks – AveryFreeman Oct 15 '20 at 05:42
1

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

Yox
  • 131
  • 1
  • 1
  • 5
  • 1
    to solve a problem remove it??? not really curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - – U.V. Aug 19 '20 at 12:09
0
  1. cd /etc/apt/sources.list.d
  2. ls (showed microsoft.sources.list.d)
  3. cd
  4. rm /etc/apt/sources.list.d/microsoft.sources.list.d

Now it has removed the message when trying to update; however, I don't know if I have done this correctly as I am new to this.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
peter
  • 1
0

For raspberrypi is kind of the same, it was just commented the source file and then executed apt update again.

# cat /etc/apt/sources.list.d/vscode.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
# deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
elulcao
  • 161
  • 4