Skip to content

Commit

Permalink
Avoid using 'apt-key add' on Debian 12
Browse files Browse the repository at this point in the history
Check which version of Debian the script is run as and place the key in
/usr/share/keyrings, as per the official recommendation.
  • Loading branch information
foop-sec committed Nov 7, 2023
1 parent e08b9a2 commit 0aa2b63
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linux/installation/mde_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,12 @@ install_on_debian()
run_quietly "mv ./microsoft.list /etc/apt/sources.list.d/microsoft-$CHANNEL.list" "unable to copy repo to location" $ERR_FAILED_REPO_SETUP

### Fetch the gpg key ###
run_quietly "curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add -" "unable to fetch the gpg key" $ERR_FAILED_REPO_SETUP
if [[ $SCALED_VERSION == 12* ]]; then
run_quietly "curl -s https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg" "unable to fetch the gpg key" $ERR_FAILED_REPO_SETUP
else
run_quietly "curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add -" "unable to fetch the gpg key" $ERR_FAILED_REPO_SETUP
fi

run_quietly "apt-get update" "[!] unable to refresh the repos properly"

### Install MDE ###
Expand Down

0 comments on commit 0aa2b63

Please sign in to comment.