Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unixodbc packages conflict with upstream packages on Ubuntu 22.04 and Debian 11 #39

Closed
dlech opened this issue Feb 14, 2023 · 47 comments
Closed
Labels
bug Something isn't working

Comments

@dlech
Copy link

dlech commented Feb 14, 2023

Describe the issue
I'm getting errors from apt about unixodbc packages.

$ sudo apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libodbc1 odbcinst odbcinst1debian2
Suggested packages:
  msodbcsql17 unixodbc-bin
The following NEW packages will be installed:
  libodbc1 odbcinst odbcinst1debian2
0 upgraded, 3 newly installed, 0 to remove and 9 not upgraded.
2 not fully installed or removed.
Need to get 0 B/607 kB of archives.
After this operation, 945 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 754326 files and directories currently installed.)
Preparing to unpack .../odbcinst_2.3.11_amd64.deb ...
Unpacking odbcinst (2.3.11) ...
dpkg: error processing archive /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb
 (--unpack):
 trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2
.3.9-5
Preparing to unpack .../odbcinst1debian2_2.3.11_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.3.11) ...
dpkg: error processing archive /var/cache/apt/archives/odbcinst1debian2_2.3.11_a
md64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is 
also in package libodbcinst2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libodbc1_2.3.11_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.11) ...
dpkg: error processing archive /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb
 (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also
 in package libodbc2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb
 /var/cache/apt/archives/odbcinst1debian2_2.3.11_amd64.deb
 /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb

When did the issue occur?
14 Febuary, 2023

If applicable, what package did you attempt to install, and from which repo?

Just doing automatic apt update. libodbc2 is used by many packages (unrelated to Microsoft). I have http://packages.microsoft.com/ in my apt sources for VS Code.

Steps to Reproduce

  • Install an Ubuntu app that uses libodbc2, for example blender.
  • Set up http://packages.microsoft.com/
  • Try to do an apt upgrade.

Actual Result

Apt fails because of conflicts. The Microsoft version of the package is shipping the v2 library in a libodbc1 package instead of a libodbc2 package. Apt tries to install both at the same time and it can't because both packages try to install the same file.

Expected Result

Microsoft should not be shipping updates to upstream packages in a general package archive like this. Or at minimum, it should be opt-in rather than opt out.

Screenshots

Additional context

@dlech dlech added the bug Something isn't working label Feb 14, 2023
@rajpawar02
Copy link

I'm having the same problem running CI on the GitHub action runner ( Ubuntu 22.04.1). The details of the error are as follows:

Preparing to unpack .../0-libodbc1_2.3.11_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.11) ...
dpkg: error processing archive /tmp/apt-dpkg-install-nDLQ5L/0-libodbc1_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package odbcinst1debian2:amd64.
Preparing to unpack .../1-odbcinst1debian2_2.3.11_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.3.11) ...
dpkg: error processing archive /tmp/apt-dpkg-install-nDLQ5L/1-odbcinst1debian2_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is also in package libodbcinst2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../2-odbcinst_2.3.11_amd64.deb ...
Unpacking odbcinst (2.3.11) over (2.3.9-5) ...
dpkg: error processing archive /tmp/apt-dpkg-install-nDLQ5L/2-odbcinst_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.9-5
Selecting previously unselected package postgresql-client.
Preparing to unpack .../3-postgresql-client_14+238_all.deb ...
Unpacking postgresql-client (14+238) ...
Preparing to unpack .../4-unixodbc_2.3.11_amd64.deb ...
Unpacking unixodbc (2.3.11) over (2.3.9-5) ...
Preparing to unpack .../5-unixodbc-dev_2.3.11_amd64.deb ...
Unpacking unixodbc-dev (2.3.11) over (2.3.9-5) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-nDLQ5L/0-libodbc1_2.3.11_amd64.deb
 /tmp/apt-dpkg-install-nDLQ5L/1-odbcinst1debian2_2.3.11_amd64.deb
 /tmp/apt-dpkg-install-nDLQ5L/2-odbcinst_2.3.11_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error: Process completed with exit code [100](https://github.com/patterninc/shipmentczar/actions/runs/4179207866/jobs/7242081737#step:6:101).

Anyone know of a solution?

@Mause
Copy link

Mause commented Feb 15, 2023

Looks like this has been raised in https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/2006998 and https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/2007288 (the second one includes a hack fix)

@fdellwing
Copy link

fdellwing commented Feb 15, 2023

Having the same problem here today with with libodbc1 package.

❯ apt-cache policy libodbc1
libodbc1:
 Installiert:           2.3.9-5
 Installationskandidat: 2.3.11
 Versionstabelle:
    2.3.11 500
       500 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages
*** 2.3.9-5 500
       500 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
       100 /var/lib/dpkg/status
    2.3.7 500
       500 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages

❯ apt-cache policy libodbc2
libodbc2:
 Installiert:           2.3.9-5
 Installationskandidat: 2.3.9-5
 Versionstabelle:
*** 2.3.9-5 500
       500 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
       100 /var/lib/dpkg/status

MS seems to ship a newer libodbc1 package that tries to overwrite a .so provided by libodbc2.

@ThorHexSec
Copy link

ThorHexSec commented Feb 15, 2023

Hi everyone, this problem persist in Ubuntu alternatives Distro (Pop OS, Zorin and Linux Mint).

This problem broken command apt dist-upgrade and Erlang Kerl Compile (Unixodbc is necessary to Erlang Kerl native or ASDF).

This temporary solution for me:

sudo dpkg --remove unixodbc

sudo dpkg --remove unixodbc-dev

I Have install erlang with snap and vscode is snap temporally until the correction.

I'm commenting on this issue to keep track of possible solutions.

@fdellwing
Copy link

The only feasible long term solution is for MS to fix their repo.

@manitgupta
Copy link

Facing the same issue with out of the blue in our GIthub action runner today:

(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 236141 files and directories currently installed.)
Preparing to unpack .../0-libodbc1_2.3.11_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.11) ...
dpkg: error processing archive /tmp/apt-dpkg-install-6gccu1/0-libodbc1_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package odbcinst1debian2:amd64.
Preparing to unpack .../1-odbcinst1debian2_2.3.11_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.3.11) ...
dpkg: error processing archive /tmp/apt-dpkg-install-6gccu1/1-odbcinst1debian2_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is also in package libodbcinst2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../2-odbcinst_2.3.11_amd64.deb ...
Unpacking odbcinst (2.3.11) over (2.3.9-5) ...
dpkg: error processing archive /tmp/apt-dpkg-install-6gccu1/2-odbcinst_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.9-5
Preparing to unpack .../3-unixodbc_2.3.11_amd64.deb ...
Unpacking unixodbc (2.3.11) over (2.3.9-5) ...

@signedav
Copy link

@rajpawar02 Fixed my CIs by installing the odbc stuff before adding the MS repositories according to this input https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/2007288/comments/3

See opengisch/QgisModelBakerLibrary@a6dfc8e

@manitgupta
Copy link

manitgupta commented Feb 15, 2023

I tried the suggested workaround in the linked bug but it did not work for me -

Commit - manitgupta/spanner-migration-tool@e30062a
Failed run - https://github.com/manitgupta/harbourbridge/actions/runs/4183240613/jobs/7247347511

@dlech
Copy link
Author

dlech commented Feb 15, 2023

EDIT: for a more complete example, jump ahead to #39 (comment)

For desktop users that don't want/need the Microsoft version of unixodbc, you can add the following to /etc/apt/preferences.d/microsoft:

Package: unixodbc
Pin: origin "packages.microsoft.com"
Pin-Priority: 100
Package: unixodbc-dev
Pin: origin "packages.microsoft.com"
Pin-Priority: 100

@fdellwing
Copy link

Even though no one from MS wrote something here, the package seems to habe been removed from the repository again and therefore this issue should no longer exist.

@fjudith
Copy link

fjudith commented Feb 16, 2023

Even though no one from MS wrote something here, the package seems to habe been removed from the repository again and therefore this issue should no longer exist.

I confirm, the issue seems to be solved.
No more install erreor.

@ThorHexSec
Copy link

I execute dist-upgrade in my Ubuntu 22.04 is not having issue in Microsoft repository.

Installation proceed normaly in Unixodbc and Unixodbc-dev.

@manitgupta
Copy link

Yes, solved now.

@falkben
Copy link

falkben commented Feb 16, 2023

running this again this morning, I'm still seeing 2.3.11 being installed with a reference to the wrong header

FROM --platform=linux/amd64 python:3.8-bullseye

RUN \
    curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && export DEBIAN_FRONTEND=noninteractive \
    && apt-get update \
    && ACCEPT_EULA=Y apt-get install --yes \
    msodbcsql17 \
    unixodbc-dev \
    && apt-get clean && rm -rf /var/lib/apt/lists/* 

RUN \
    pip install --no-binary :all: pyodbc

pinning unixodbc-dev=2.3.7 unixodbc=2.3.7 odbcinst1debian2=2.3.7 odbcinst=2.3.7 still works

@fdellwing
Copy link

@falkben This was so far about the Ubuntu 22 repo. It seems that the Debian 11 repo is also and still affected (while Ubuntu is fixed).

@dlech dlech changed the title unixodbc packages conflict with upstream packages on Ubuntu 22.04 unixodbc packages conflict with upstream packages on Ubuntu 22.04 and Debian 11 Feb 16, 2023
@ethrya
Copy link

ethrya commented Feb 17, 2023

I understand that I am still having this issue on Ubuntu 20.04.

It looks like the packages have not been removed from the packages files as I can still see them (e.g. libodbc) here: https://packages.microsoft.com/ubuntu/20.04/prod/dists/focal/main/)

@alanplarium
Copy link

It is still failing for me. Anyone else still could not resolve the issue?

@David-Engel
Copy link

This should be addressed now. The unixodbc 2.3.11 packages were removed for Ubuntu 22.04 and higher. Use the unixodbc packages provided by Ubuntu. For Debian 10, 11, and Ubuntu 20.04, 18.04, an updated package, 2.3.11-1, was published with a fix for the header issue.

@alanplarium
Copy link

alanplarium commented Feb 22, 2023

@David-Engel It is still failing for me. I am building a docker image and fails in one of these steps:

RUN sudo su \ && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list

I get these errors:
dpkg: error processing archive /var/cache/apt/archives/libodbc1_2.3.11-1_amd64.deb (--unpack):
dpkg: error processing archive /var/cache/apt/archives/odbcinst1debian2_2.3.11-1_amd64.deb (--unpack):

Anything you think I should change?

@sheikx1221
Copy link

removing these packages is a pain you don't want to feel
here is the therapy

sudo dpkg --remove unixodbc-dev unixodbc

then you need to edit postrm script of msodbcsql17 using root
sudo vim /var/lib/dpkg/info/msodbcsql17.postrm

comment the two lines in postrm that start with odbcinst and db_purge in the remove section and save

sudo apt-get remove msodbcsql17
sudo apt remove unixodbc unixodbc-dev odbcinst odbcinst1debian2 libodbc1 msodbcsql17 mssql-tools

Then follow this tutorial for 22.04 ubuntu desktop

daniilly added a commit to dreamfactorysoftware/dreamfactory that referenced this issue Mar 3, 2023
Update package dependencies

Upgrade to Laravel 9

The installers update includes several changes:
- Support of Fedora v34, v35 and Ubuntu v18 has been discontinued.
- Add support for Fedora v37 and Ubuntu v22.
- Upgrade dependencies to PHP 8.1.

There is an issue with the include in the latest version
of unixodbc-dev v2.3.11. As a temporary solution, we have
reverted to a previous version that does not have this problem.
For more information, please refer to the related issues:
- microsoft/linux-package-repositories#36
- microsoft/linux-package-repositories#39
daniilly added a commit to dreamfactorysoftware/dreamfactory that referenced this issue Mar 6, 2023
Update package dependencies

Upgrade to Laravel 9

The installers update includes several changes:
- Support of Fedora v34, v35 and Ubuntu v18 has been discontinued.
- Add support for Fedora v37 and Ubuntu v22.
- Upgrade dependencies to PHP 8.1.

There is an issue with the include in the latest version
of unixodbc-dev v2.3.11. As a temporary solution, we have
reverted to a previous version that does not have this problem.
For more information, please refer to the related issues:
- microsoft/linux-package-repositories#36
- microsoft/linux-package-repositories#39
@sdherr
Copy link
Contributor

sdherr commented Mar 23, 2023

Is there still a problem here or can I close this issue? I've tested things out in Debian 11 and Ubuntu 18.04 and it seems to work currently. If something is still broken we need a more clear reproducer.

From an arbitrary machine with docker (or similar) installed: docker run -it debain:11 (or ubuntu:18.04):

apt-get update
apt-get install wget blender
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb
# or, on Ubuntu:
# wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
apt-get install ./packages-microsoft-prod.deb
apt-get update
apt-get upgrade
# -> works

@dlech
Copy link
Author

dlech commented Mar 23, 2023

It's been a few weeks since any chatter, so I'll go ahead and close it and see if anyone objects.

@fcorrigabb
Copy link

The problem is still there.

@pborquez
Copy link

Until today, the problem is still here but this is the way I solved the issue using a Debian image:

FROM php:8.2.1-apache-bullseye as production

RUN set -eux; \
  apt-get update; \
  apt-get install -y --no-install-recommends \
    gnupg \
    wget \
    curl \
  ; \
  curl -SL --progress-bar https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \
  curl -SL --progress-bar https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list; \
  apt-get update; \
  ACCEPT_EULA=Y apt-get install -y msodbcsql18; \
  apt-get install -y unixodbc-dev; \
  sed -i -E 's/(CipherString\s*=\s*DEFAULT@SECLEVEL=)2/\11/' /etc/ssl/openssl.cnf; \
  rm -rf /var/lib/apt/lists/*;

RUN set -eux; \
  pecl install \
    sqlsrv \
    pdo_sqlsrv \
  ; \
  docker-php-ext-enable \
    sqlsrv \
    pdo_sqlsrv \
  ; \
  echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; \
  echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`;

@rb12345
Copy link

rb12345 commented May 26, 2023

It might be worth noting that this breaks upgrades from bullseye to bookworm if anything else depends on the library.

@ameryu716
Copy link

@pborquez
curl -SL --progress-bar https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list; \
Acturally thanks!!
I was freed from the bondage of two hours.

@killerkalamari
Copy link

killerkalamari commented Jun 11, 2023

This got me past the problem on a Debian 11 to 12 (bullseye to bookworm) dist-upgrade: sudo apt remove python3-gdal libgdal32 libgdal28 libodbc1. Nothing else seemed to depend on those in my case.

@stlrnz
Copy link

stlrnz commented Jun 15, 2023

I can confirm that I still have to use the ubuntu repository for my debian 11 docker container to install the PHP sqlsrv extension.

RUN apt install -y gpg \
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt update

RUN ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18 \
    && apt install -y unixodbc-dev \
    && pecl install sqlsrv \
    && docker-php-ext-enable sqlsrv

If I switch to https://packages.microsoft.com/config/debian/11/prod.list the build will fail.

@mbomb007
Copy link

Yes, this still fails when using debian. I have to include the following line in my script:

apt-get install -y --allow-downgrades unixodbc-dev=2.3.7 unixodbc=2.3.7 odbcinst1debian2=2.3.7 odbcinst=2.3.7

@mangelozzi
Copy link

Why is this issue closed? It is still broken with Ubuntu 22.04.

@fcorrigabb
Copy link

Because devs do not care. This is a widespread issue and it's causing a pletora of problems... but devs do not care to fix the conflicts.

@mbomb007
Copy link

Is there still a problem here or can I close this issue? I've tested things out in Debian 11 and Ubuntu 18.04 and it seems to work currently. If something is still broken we need a more clear reproducer.

From an arbitrary machine with docker (or similar) installed: docker run -it debain:11 (or ubuntu:18.04):

apt-get update
apt-get install wget blender
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb
# or, on Ubuntu:
# wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
apt-get install ./packages-microsoft-prod.deb
apt-get update
apt-get upgrade
# -> works

They did say they need a clear way to reproduce the issue. Could someone create that?

@fcorrigabb
Copy link

fcorrigabb commented Jul 18, 2023

It's in the initial report, it works only when unixodbc ver 2.3.6 is already installed and, as you know, 2.3.6 is outdated and buggy.

@sdherr
Copy link
Contributor

sdherr commented Jul 18, 2023

Okay, I can now reproduce the issue. Building this Dockerfile for example fails:

FROM debian:11

RUN apt update
RUN apt install -y gpg curl php-dev
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt update

RUN ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18
RUN apt install -y unixodbc-dev
RUN pecl install sqlsrv

This appears to be a duplicate of this issue, where they note not only the "use the Ubuntu repo" workaround but also a "use an older version of unixodbc" workaround:

&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 odbcinst=2.3.7 odbcinst1debian2=2.3.7 unixodbc-dev=2.3.7 unixodbc=2.3.7 \

The root cause appears to be (and here I'm only reading the comments in that issue) that these packages were built from a broken version of upstream unixodbc=2.3.11, which was later fixed in unixodbc=2.3.11-2. Fixing the packages in the Microsoft repo would involve rebuilding them on the fixed -2 version.

I recommend everyone move this discussion to that issue, since it's actually filed against the team that can help here. I'll also ping them internally with the reproducer and explanation.

@SirArthur7
Copy link

SirArthur7 commented Sep 15, 2023

I found the following code snippet from Microsoft page to Install the Microsoft ODBC driver for SQL Server (Linux), and it works perfectly fine-

curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17

@mbomb007
Copy link

mbomb007 commented Sep 15, 2023

I found the following code snippet from Microsoft page to Install the Microsoft ODBC driver for SQL Server (Linux), and it works perfectly fine-

curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17

You should know that adding a key to /etc/apt/trusted.gpg.d is insecure:

Adding a key to /etc/apt/trusted.gpg.d is insecure because it adds the key for all repositories. This is exactly why apt-key had to be deprecated.

@SirArthur7
Copy link

SirArthur7 commented Sep 16, 2023

You should know that adding a key to /etc/apt/trusted.gpg.d is insecure:

Adding a key to /etc/apt/trusted.gpg.d is insecure because it adds the key for all repositories. This is exactly why apt-key had to be deprecated.

Hey @mbomb007 thanks for letting me know, I wasn't aware of that. So what do you suggest I should do in order to get around this issue?

Actually I found another solution that works perfectly fine too, turned out I just needed to install unixodbc-dev before the rest-

apt-get install -y unixodbc-dev
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -q -y install msodbcsql17

@mbearup
Copy link
Collaborator

mbearup commented Sep 18, 2023

@SirArthur7 the recommended path is to use the signed-by option as explained in the Debian docs.
This option specifies where the pubkey for a given repo can be found.
We (packages.microsoft.com) are updating our configs to align with this standard (see the Debian 12 configs as an example).
I can't speak to apt-key but I know that add-apt-repository still installs pubkeys to the "wrong" location (/etc/apt/trusted.gpg.d).

@mbomb007
Copy link

mbomb007 commented Sep 18, 2023

The new file format for apt sources is known as DEB822. As an example, for MariaDB it looks like:

Types: deb
URIs: https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/ubuntu
Suites: jammy
Components: main main/debug
Architectures: amd64 arm64
Signed-By: /etc/apt/keyrings/mariadb-keyring-2019.gpg

[... more entries ...]

And the keyring was obtained with

sudo curl -LsSo /etc/apt/keyrings/mariadb-keyring-2019.gpg https://supplychain.mariadb.com/mariadb-keyring-2019.gpg

I manually converted the default-style file that was created when using the setup script into the new DEB822 format.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests