GPG error when I want to apt update

8,933

Solution 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

Solution 2

load the key from microsoft

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Share:
8,933

Related videos on Youtube

Yox
Author by

Yox

Updated on September 18, 2022

Comments

  • Yox
    Yox almost 2 years

    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
      Jeff Schaller about 5 years
      Has Kali changed their policy regarding 3rd-party repositories? Last I knew, they only wanted kali.org in the sources.list...
    • Jeff Schaller
      Jeff Schaller about 5 years
    • Yox
      Yox about 5 years
      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
    • Sparhawk
      Sparhawk about 5 years
      @JeffSchaller You are correct: "Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL."
  • U.V.
    U.V. almost 4 years
    to solve a problem remove it??? not really curl packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
  • AveryFreeman
    AveryFreeman over 3 years
    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