0

I am trying to install (not by my choice) the Microsoft Windows Defender. For that i need to add a repository key:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –

But this does not work anymore. I made then this to get the file:

curl https://packages.microsoft.com/keys/microsoft.asc -o /usr/local/share/keyrings/microsoft_windows_defender.key

I checked the file:

file usr/local/share/keyrings/microsoft_windows_defender.key

returns:

PGP public key block Public-Key (old)

then i created the source file

nano /etc/apt/sources.list.d/microsoft-prod.list

containing:

deb  [arch=amd64,armhf,arm64 signed-by=/usr/share/keyrings/microsoft_windows_defender.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main

But when i run

apt update

It gives an error:

 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease: NO_PUBKEY EB3E94ADBE1229CF

Can anyone help to fix this? Thank you.

1 Answers1

2

From https://itsfoss.com/apt-key-deprecated/

  1. The keys have to be dearmored and added in binary format. $ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/microsoft_windows_defender.gpg

  2. $ echo " deb [signed-by=/usr/share/keyrings/microsoft_windows_defender.gpg arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" | sudo tee /etc/apt/sources.list.d/microsoft-prod.list

  3. $ sudo apt update

guest
  • 36