From f40863af77654d7aad608f8b9d6796e852f7de6d Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 25 Aug 2021 09:05:17 +0200 Subject: [PATCH] Don't use apt-get add on Debian Bullseye --- install-php-extensions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install-php-extensions b/install-php-extensions index 1bb2978..6280484 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1385,7 +1385,12 @@ installMicrosoftSqlServerODBC() { debian) # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17 printf -- '- installing the Microsoft APT key\n' - curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + if test $DISTRO_VERSION_NUMBER -ge 11; then + # apt-key is deprecated + curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc + else + curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + fi if ! test -f /etc/apt/sources.list.d/mssql-release.list; then printf -- '- adding the Microsoft APT source list\n' curl -sSLf https://packages.microsoft.com/config/debian/$DISTRO_VERSION_NUMBER/prod.list >/etc/apt/sources.list.d/mssql-release.list