Score:3

cannot install msodbcsql17

cn flag

I am having issues install msodbcsql17 in my docker container. I tried suggestions similar to Unable to install msodbcsql17 on Ubuntu 18.04, but still received the error:

ACCEPT_EULA=Y apt-get install -y msodbcsql17' returned a non-zero code: 100

The relevant part of my docker is as per https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16&tabs=alpine18-install%2Calpine17-install%2Cdebian8-install%2Credhat7-13-install%2Crhel7-offline:

# Install odbc
RUN sudo su

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

RUN curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

RUN exit
RUN sudo apt-get update
RUN ACCEPT_EULA=Y apt-get install -y -f --allow-unauthenticated msodbcsql17

the build logs show:

    2023-02-14T11:24:12.9877442Z Step 27/50 : RUN sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
2023-02-14T11:24:13.0005547Z  ---> Running in a7a3ed4e4230
2023-02-14T11:24:14.0556490Z Reading package lists...
2023-02-14T11:24:14.2368492Z Building dependency tree...
2023-02-14T11:24:14.2373749Z Reading state information...
2023-02-14T11:24:14.4506218Z The following additional packages will be installed:
2023-02-14T11:24:14.4512003Z   libodbc1 odbcinst odbcinst1debian2 unixodbc
2023-02-14T11:24:14.4547419Z Suggested packages:
2023-02-14T11:24:14.4548055Z   unixodbc-bin
2023-02-14T11:24:14.4818545Z The following NEW packages will be installed:
2023-02-14T11:24:14.4825198Z   libodbc1 msodbcsql17 odbcinst odbcinst1debian2 unixodbc
2023-02-14T11:24:14.5628173Z 0 upgraded, 5 newly installed, 0 to remove and 10 not upgraded.
2023-02-14T11:24:14.5629831Z Need to get 1,403 kB of archives.
2023-02-14T11:24:14.5630312Z After this operation, 1,059 kB of additional disk space will be used.
2023-02-14T11:24:14.5630974Z Get:1 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 libodbc1 amd64 2.3.11 [486 kB]
2023-02-14T11:24:14.6116793Z Get:2 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 odbcinst1debian2 amd64 2.3.11 [99.7 kB]
2023-02-14T11:24:14.6131997Z Get:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 odbcinst amd64 2.3.11 [21.3 kB]
2023-02-14T11:24:14.6137953Z Get:4 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 unixodbc amd64 2.3.11 [51.5 kB]
2023-02-14T11:24:14.6146273Z Get:5 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 msodbcsql17 amd64 17.10.2.1-1 [745 kB]
2023-02-14T11:24:14.8246420Z [91mdebconf: delaying package configuration, since apt-utils is not installed
2023-02-14T11:24:14.8685476Z [0mFetched 1,403 kB in 0s (10.5 MB/s)
2023-02-14T11:24:14.8975174Z Selecting previously unselected package libodbc1:amd64.
2023-02-14T11:24:14.9027991Z (Reading database ... 
2023-02-14T11:24:14.9028621Z (Reading database ... 5%
2023-02-14T11:24:14.9028984Z (Reading database ... 10%
2023-02-14T11:24:14.9029349Z (Reading database ... 15%
2023-02-14T11:24:14.9029712Z (Reading database ... 20%
2023-02-14T11:24:14.9036996Z (Reading database ... 25%
2023-02-14T11:24:14.9037427Z (Reading database ... 30%
2023-02-14T11:24:14.9037786Z (Reading database ... 35%
2023-02-14T11:24:14.9038144Z (Reading database ... 40%
2023-02-14T11:24:14.9038503Z (Reading database ... 45%
2023-02-14T11:24:14.9038860Z (Reading database ... 50%
2023-02-14T11:24:14.9039200Z (Reading database ... 55%
2023-02-14T11:24:14.9069635Z (Reading database ... 60%
2023-02-14T11:24:14.9091296Z (Reading database ... 65%
2023-02-14T11:24:14.9171951Z (Reading database ... 70%
2023-02-14T11:24:14.9209030Z (Reading database ... 75%
2023-02-14T11:24:14.9287303Z (Reading database ... 80%
2023-02-14T11:24:14.9321749Z (Reading database ... 85%
2023-02-14T11:24:14.9348514Z (Reading database ... 90%
2023-02-14T11:24:14.9369616Z (Reading database ... 95%
2023-02-14T11:24:14.9370004Z (Reading database ... 100%
2023-02-14T11:24:14.9370415Z (Reading database ... 64137 files and directories currently installed.)
2023-02-14T11:24:14.9398390Z Preparing to unpack .../libodbc1_2.3.11_amd64.deb ...
2023-02-14T11:24:14.9410458Z Unpacking libodbc1:amd64 (2.3.11) ...
2023-02-14T11:24:14.9446555Z dpkg: error processing archive /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb (--unpack):
2023-02-14T11:24:14.9448446Z  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
2023-02-14T11:24:14.9453201Z dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
2023-02-14T11:24:14.9600783Z Selecting previously unselected package odbcinst1debian2:amd64.
2023-02-14T11:24:14.9657111Z Preparing to unpack .../odbcinst1debian2_2.3.11_amd64.deb ...
2023-02-14T11:24:14.9670061Z Unpacking odbcinst1debian2:amd64 (2.3.11) ...
2023-02-14T11:24:14.9702481Z dpkg: error processing archive /var/cache/apt/archives/odbcinst1debian2_2.3.11_amd64.deb (--unpack):
2023-02-14T11:24:14.9703365Z  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
2023-02-14T11:24:14.9712820Z dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
2023-02-14T11:24:14.9879447Z Selecting previously unselected package odbcinst.
2023-02-14T11:24:14.9879982Z Preparing to unpack .../odbcinst_2.3.11_amd64.deb ...
2023-02-14T11:24:14.9896590Z Unpacking odbcinst (2.3.11) ...
2023-02-14T11:24:14.9924471Z dpkg: error processing archive /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb (--unpack):
2023-02-14T11:24:14.9925203Z  trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.9-5
2023-02-14T11:24:15.0031636Z Selecting previously unselected package unixodbc.
2023-02-14T11:24:15.0086839Z Preparing to unpack .../unixodbc_2.3.11_amd64.deb ...
2023-02-14T11:24:15.0099782Z Unpacking unixodbc (2.3.11) ...
2023-02-14T11:24:15.0345718Z Selecting previously unselected package msodbcsql17.
2023-02-14T11:24:15.0408910Z Preparing to unpack .../msodbcsql17_17.10.2.1-1_amd64.deb ...
2023-02-14T11:24:15.1308373Z debconf: unable to initialize frontend: Dialog
2023-02-14T11:24:15.1308981Z debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
2023-02-14T11:24:15.1309532Z debconf: falling back to frontend: Readline
2023-02-14T11:24:15.1900197Z Unpacking msodbcsql17 (17.10.2.1-1) ...
2023-02-14T11:24:15.2861152Z Errors were encountered while processing:
2023-02-14T11:24:15.2911953Z  /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb
2023-02-14T11:24:15.2913469Z  /var/cache/apt/archives/odbcinst1debian2_2.3.11_amd64.deb
2023-02-14T11:24:15.2913914Z  /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb
2023-02-14T11:24:15.3017753Z [91mW: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
2023-02-14T11:24:15.3019957Z W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
2023-02-14T11:24:15.3021244Z E: Sub-process /usr/bin/dpkg returned an error code (1)
2023-02-14T11:24:15.4448720Z [0mThe command '/bin/sh -c sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17' returned a non-zero code: 100
2023-02-14T11:24:15.4513491Z ##[error]The command '/bin/sh -c sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17' returned a non-zero code: 100
2023-02-14T11:24:15.4573901Z ##[error]The process '/usr/bin/docker' failed with exit code 100
2023-02-14T11:24:15.4707763Z ##[section]Finishing: Build and push an image to container registry

vs an earlier successful run

2023-02-11T19:37:57.4354185Z Step 26/48 : RUN sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
2023-02-11T19:37:57.4581744Z  ---> Running in 4a4103163268
2023-02-11T19:37:58.7290566Z Reading package lists...
2023-02-11T19:37:58.9192709Z Building dependency tree...
2023-02-11T19:37:58.9198211Z Reading state information...
2023-02-11T19:37:59.0809251Z The following additional packages will be installed:
2023-02-11T19:37:59.0810747Z   odbcinst unixodbc
2023-02-11T19:37:59.1386647Z The following NEW packages will be installed:
2023-02-11T19:37:59.1387518Z   msodbcsql17 odbcinst unixodbc
2023-02-11T19:37:59.1701331Z 0 upgraded, 3 newly installed, 0 to remove and 9 not upgraded.
2023-02-11T19:37:59.1702280Z Need to get 781 kB of archives.
2023-02-11T19:37:59.1703277Z After this operation, 164 kB of additional disk space will be used.
2023-02-11T19:37:59.1704324Z Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 odbcinst amd64 2.3.9-5 [10.0 kB]
2023-02-11T19:37:59.1755448Z Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 unixodbc amd64 2.3.9-5 [26.8 kB]
2023-02-11T19:37:59.2515376Z Get:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 msodbcsql17 amd64 17.10.2.1-1 [745 kB]
2023-02-11T19:37:59.5305134Z [91mdebconf: delaying package configuration, since apt-utils is not installed
2023-02-11T19:37:59.5643111Z [0mFetched 781 kB in 0s (4,644 kB/s)
2023-02-11T19:37:59.5877856Z Selecting previously unselected package odbcinst.
2023-02-11T19:37:59.5980771Z (Reading database ... 
2023-02-11T19:37:59.5982730Z (Reading database ... 5%
2023-02-11T19:37:59.5984208Z (Reading database ... 10%
2023-02-11T19:37:59.5985015Z (Reading database ... 15%
2023-02-11T19:37:59.5985666Z (Reading database ... 20%
2023-02-11T19:37:59.5986961Z (Reading database ... 25%
2023-02-11T19:37:59.5987600Z (Reading database ... 30%
2023-02-11T19:37:59.5988115Z (Reading database ... 35%
2023-02-11T19:37:59.5988607Z (Reading database ... 40%
2023-02-11T19:37:59.5989105Z (Reading database ... 45%
2023-02-11T19:37:59.5989577Z (Reading database ... 50%
2023-02-11T19:37:59.5990064Z (Reading database ... 55%
2023-02-11T19:37:59.6033063Z (Reading database ... 60%
2023-02-11T19:37:59.6064217Z (Reading database ... 65%
2023-02-11T19:37:59.6082834Z (Reading database ... 70%
2023-02-11T19:37:59.6110601Z (Reading database ... 75%
2023-02-11T19:37:59.6195444Z (Reading database ... 80%
2023-02-11T19:37:59.6237561Z (Reading database ... 85%
2023-02-11T19:37:59.6271852Z (Reading database ... 90%
2023-02-11T19:37:59.6295395Z (Reading database ... 95%
2023-02-11T19:37:59.6295782Z (Reading database ... 100%
2023-02-11T19:37:59.6296217Z (Reading database ... 64137 files and directories currently installed.)
2023-02-11T19:37:59.6312515Z Preparing to unpack .../odbcinst_2.3.9-5_amd64.deb ...
2023-02-11T19:37:59.6335557Z Unpacking odbcinst (2.3.9-5) ...
2023-02-11T19:37:59.6575371Z Selecting previously unselected package unixodbc.
2023-02-11T19:37:59.6628297Z Preparing to unpack .../unixodbc_2.3.9-5_amd64.deb ...
2023-02-11T19:37:59.6645776Z Unpacking unixodbc (2.3.9-5) ...
2023-02-11T19:37:59.6936338Z Selecting previously unselected package msodbcsql17.
2023-02-11T19:37:59.6983964Z Preparing to unpack .../msodbcsql17_17.10.2.1-1_amd64.deb ...
2023-02-11T19:37:59.7900514Z debconf: unable to initialize frontend: Dialog
2023-02-11T19:37:59.7901298Z debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
2023-02-11T19:37:59.7901875Z debconf: falling back to frontend: Readline
2023-02-11T19:37:59.8448156Z Unpacking msodbcsql17 (17.10.2.1-1) ...
2023-02-11T19:37:59.9600325Z Setting up odbcinst (2.3.9-5) ...
2023-02-11T19:37:59.9641147Z Setting up unixodbc (2.3.9-5) ...
2023-02-11T19:37:59.9694826Z Setting up msodbcsql17 (17.10.2.1-1) ...
2023-02-11T19:37:59.9786648Z odbcinst: Driver installed. Usage count increased to 1. 
2023-02-11T19:37:59.9787144Z     Target directory is /etc
2023-02-11T19:38:00.0084995Z [91mW: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
2023-02-11T19:38:00.0088695Z W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
2023-02-11T19:38:03.7513881Z [0mRemoving intermediate container 4a4103163268
2023-02-11T19:38:03.7514509Z  ---> 5a93ebb5f6af
Score:0
ru flag

THis is the reason:

2023-02-14T11:40:11.2355856Z dpkg: error processing archive /tmp/apt-dpkg-install-dulMkE/2-odbcinst_2.3.11_amd64.deb (--unpack):
2023-02-14T11:40:11.2361186Z  trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.9-5

This is a known incompatibility when trying to install Microsoft's ODBC package and the on-system unixodbc package. They are not co-installable and that is a limitation of the Microsoft implementation in the repositories.

Because these two packages conflict, you need to either:

  1. Remove unixodbc-common and anything that depends on it and install msodbcsql17, or
  2. Abandon your efforts to install msodbcsql17.

There's unfortunately no other way around this at the moment, and it seems to be a global problem with Microsoft's packaging. You may wish to reach out to Microsoft and report this as an issue with the packaging.

(Also you have Google Chrome repositories configured twice, remove one of the entries / files in /etc/apt/sources.list.d/ that contains the Chrome repos)

frank avatar
cn flag
Thanks for suggestion. Updated question to show that this package was installed on its own, installled at `2023-02-14T11:24:14.4548055Z `
ru flag
@frank Then you need to file a bug with Microsoft about that package conflicting. You may want to consider using `msodbcsql18` which is newer but is reverse compatible with 17 to my knowledge.
frank avatar
cn flag
I will try 18, thanks. To make it worse, when I build the image on my local machine, it builds fine
ru flag
@frank Don't forget that depending on which OS you're using on your host machine vs. your docker container, you will see different things. I know that this bug continues to exist elsewhere, but you may ultimately just need Microsoft to fix their stuff and conflicts.
frank avatar
cn flag
Had exact same error with 18. Will contact MSFT and ask what changed.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.