Debian 12 public key is not available

Pablo Burgos 30 Reputation points
2023-07-12T09:52:33.2833333+00:00

Trying to install mssql-tools, after registering the repository for Debian 12 (Docker image):

  RUN curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc 	&& \
curl https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/msprod.list && \
# install SQL Server drivers
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
unixodbc-dev \
mssql-tools

I get the following errors:

49.02 W: GPG error: https://packages.microsoft.com/debian/12/prod bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

49.02 E: The repository 'https://packages.microsoft.com/debian/12/prod bookworm InRelease' is not signed.

I've been following this guide:

https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver16#tools

Also, it does work for Debian 11 (Also, it does work for Debian 11 (https://packages.microsoft.com/config/debian/11/prod.list))

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,899 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Philip Z 35 Reputation points
    2023-09-19T18:40:07.99+00:00

    The problem here is apt changed the way it verified signatures. And MS has not updated the process for Debian 12.

    I found the solution on another article with Ubuntu. Use this command to properly import the signature:

    curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
    

    Now, to figure out where mssql-tools are for Debian 12! Apparently mssql-tools18 nor msodbcsql18 exist. :/

    7 people found this answer helpful.

  2. Wartenberg Jan Philipp FRD 5 Reputation points
    2023-08-08T13:57:17.6066667+00:00

    Is it possible that the correct solution is "Use Version for Debian 11"?

    I tried to fix the problem.

    "sudo apt-key adv" as suggested in Aniya's link, to set a key, is deprecated. The proper solution seems to be to store the key in something like "/etc/apt/keyrings/microsoft.asc" (could be any location) and refer to it in the respective sources.list (See verbose solution: https://askubuntu.com/a/1307181)

    I applied this for my issue. Using Debian 12, I can install the driver msodbcsql17 and mssql-tools from https://packages.microsoft.com/config/debian/11/prod.list. Querying a MSSQL DB from docker works.

    However for 12 I only get:
    E: Unable to locate package msodbcsql17

    I am not sure what the implications or risks are mixing up the versions. For me it looks like this is the only functioning way. I am open for other suggestions.

    1 person found this answer helpful.
    0 comments No comments

  3. AniyaTang-MSFT 12,331 Reputation points Microsoft Vendor
    2023-07-13T05:53:07.5+00:00

    Hi @Pablo Burgos

    Please refer to this link: https://unix.stackexchange.com/questions/75807/no-public-key-available-on-apt-get-update.

    Hope this helps you.

    Best regards,

    Aniya


  4. Luca Maurelli 30 Reputation points
    2023-12-04T12:12:52.94+00:00

    I don't see anymore the documentation for Debian. Did MS dropped the support for Debian since its 12 version release?

    0 comments No comments

  5. Jeff L 0 Reputation points
    2024-04-16T19:10:59.7433333+00:00

    Following this page worked for me: https://learn.microsoft.com/en-us/linux/packages#command-examples-for-using-the-linux-repository-service

    mssql-tools 17 & 18 are now available to install

    0 comments No comments