ODBC drivers for Ubuntu 22.04

Copper Contributor

I recently installed Lubuntu 22.04 and following these instructions to install the ODBC drivers but apparently MS hasn't packaged msodbcsql18 or 17 for this version.

 

Any ETA for those to be released?

 

Related question: https://askubuntu.com/questions/1407533/microsoft-odbc-v18-is-not-find-by-apt

 

Thanks,

CaldeiraG

17 Replies
The repository for Ubuntu 22 exists but the number of packages is very limited at the moment.
SQL-Server drivers are currently still missing in the repo.
I was building a new Ubuntu 22.04 production and this was a hard stop for me. Everything worked except for this and it burned up hours of my time. I had to fall back to 20.04 just because of this one issue :(

Hopefully someone gets on top of this so we can better support the Ubuntu community.
I got it working by following an answer from the askubuntu.com link on the original question that explained how to install from the Ubuntu 21.10 repo
https://askubuntu.com/a/1409311/112312

@AngeloJr - Confirmed on a XUbuntu 22.04 test VM:

 

sudo apt-get install odbcinst

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

echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/21.10/prod impish main" | sudo tee /etc/apt/sources.list.d/mssql-release.list

sudo apt update

sudo apt install msodbcsql18

@Timothy_Quinn This looked really promising but when I try this in Mint 21.0 the final step results in the following:-

sudo apt install msodbcsql18
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
msodbcsql18 : Depends: unixodbc (>= 2.3.1)
E: Unable to correct problems, you have held broken packages.

If I try to install unixodbc I'm hit with another missing dependency:-
libodbc2 : Breaks: libodbc1 (< 2.3.9-1~) but 2.3.7 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

 

Etc, etc.

Really wish MS, having offered SQL Server for Linux, could keep up at least with the main LTS's.  22.04 has been out now for 8 months and MS will no doubt have had industry pre-knowledge.  People are using it for development and production so it's now really important.

Rgds

When will this issue be resolved. Come April there will be no more official security updated for ubunto 20.04. all our servers will be upgraded to ubunto 22.04 with ssl3. Microsoft ODBC drivers do not support openSSL 3 as of yet. This is a huge problem is any one looking into this? 

Paging @David-Engel hopefully we can gain some optics on this. Pointing to a different version of ubuntu to force install drivers/packages on a later version, I would imagine, is not recommended.

@CaldeiraG 

 

It appears that the instructions for installing ODBC on Ubuntu 22.04 and Debian 11.

 

I also got the v17 driver working on Linux Mint 21.1 as follows:

 

sudo su
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
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

 To use v18, just change to line with msodbcsql17 to use  msodbcsql18

@Timothy_Quinn 

 

This is not working. 

Ubunto 22.04 is using openssl 3. Microsoft doesn't seem to care about updating their drivers to support openSSL 3. 

Currently they are only supporting openssl1 with ODBC driver 17.

We are currently exploring switching all our servers and clients data to PostgreSQL. That's approximately 300 clients data. The software is developed in house, so a switch from MS SQL will be a pain but it is do able. I know Microsoft doesn't care about this and never will, we are not big enough to matter to them. We are waiting till April first to see if there are any solutions from the linux community. It is the end of life for ubunto 20.04, as it will not be maintained any more. and all our servers will be upgraded to 22.04.  

 

You are right, I'm beginning to wish MS hadn't bothered trying to be trendy and produce a Linux version of SQL Server. If they're not going to keep it up to date, it's totally irrelevant and a waste of effort. Sorry, but it just is. People don't just host on Linux servers, sum of us develop on Linux desktop machines too. No way are we going to put ourselves at risk just because MS can't produce software in a competent fashion. Hopefully they'll improve in time, but it's time we don't have. So we have to muck about with Docker as before and ignore the so called "SQL Server for Linux". I bet they withdraw it soon anyway.

There are hacks to down grade Openssl 3 to V1 . but I don't see the logic in compromising one systems security for Microsoft.
If you are developing in Python and Django there you can import pymssql. This does not require any Microsoft drivers however it is no longer maintained and you do have to modify a bit of code to make it work. Microsof and Mac both need to just be honest and say "We have no interest in working with anyone else. If you don't like it leave" instead of pretending to support different OS half the time. There are so many Database options out there that support all OS platforms that there is no need to develop in Microsoft SQL server. As a developer I will always support platforms that are universal, It just makes my life easy.
They have one month to make a patch before we start switching all our clients over to postgress.

@Timothy_Quinn 

 

My test Mint 21 system (Ubuntu 22.04.x based) was blocked from being able to be updated.

 

When I did a `sudo apt-get upgrade`, It failed and I was prompted to run `sudo apt --fix-broken install` which when was run would also fail due to the odbc drivers.

 

I followed these instructions to remove the offending packages: https://superuser.com/a/1439244/247361

 

It took a few tries and I had to remove `unixodbc-common`, `libodbc2`, `libodbcinst2`, `odbcinst1debian2` before `sudo apt --fix-broken install` would run ok.

 

I'm in the process of upgrading my test VM and will add notes if I hit a wall with this driver again.

 

[Update] - Afetr updating and trying `sqlcmd` it failed with `sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib 'ODBC Driver 17 for SQL Server' : file not found`. To fix, I had to remove `msodbcsql17` and then re-install along with mssql-tools.

Hi @CaldeiraG , all

Option 1: According to Microsoft documentation it is well supported.

In this quickstart, you install SQL Server 2022 (16.x) on Ubuntu 20.04.

 

Please follow this document:

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

 

 

Option 2: You can install Docker into Ubuntu 22.04.

(1) Install Docker Engine on Ubuntu:

https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository

(2) Install SQL Server Container:

https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&...

 

@Ronen_Ariely 

 

Already in the process of switching all our clients to PostgreSQL. It is way cheaper as well. 

 

 

cheaper will be to use notepad :happyface:

"cheaper" is just one parameter to take into consideration out of of tens of parameters, but we cannot know what best fit your needs, only you should know. Good luck with any decision to got.

postgresSQL is a well balanced and well known database. With out understand our company needs and how we are using it makes it difficult for you to comment on in intelligently.
If we are using only 50% of the capabilities of MS SQL and PostgresSQL can do everything we need but is 1/2 the price to get the servers running then yes it is Cheaper. and it will do everything we need it to.

Hi @steve60 

 

> postgresSQL is a well balanced and well known database.

 

You are totally current. It is a great database server which can fit most cases. My last response was not related to this specific solution but just noted about the reason you mentioned "cheaper". I just wanted to emphasize that cheaper is just one parameter when you select the solution.

 

I am sure your will have an awesome system

 

Have a great day