This is the procedure to be able to use SQL Server tools on a Debian 11 system. It worked on March 04, 2022.
- Run a container
docker run --rm --name dotnetsdk -it mcr.microsoft.com/dotnet/sdk:6.0 bash
- Install SQL Server tools steps (docs)
apt-get update
apt-get install -y gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/msprod.list
# not needed anymore but fixed a temporary issue (https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey)
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
apt-get update
apt-get install -y mssql-tools unixodbc-dev
/opt/mssql-tools/bin/sqlcmd -?