Repair SQL Server on Linux after an Ubuntu distribution upgrade

broken glass

SQL Server 2017 is supported on Ubuntu 16.04 LTS (Long-Term Support), however that version of Ubuntu Linux is now more than two years old, so you may be tempted to update Ubuntu to a more modern release such as Ubuntu 18.04 LTS (Bionic Beaver). Unfortunately (as of this writing), SQL Server 2017 is not supported on later versions of Ubuntu.

(Note: Ubuntu releases new distributions every six months. The version number 16.04 means that it was released in April 2016.)

The more adventurous among us who use SQL Server 2017 in a development environment — where we need to keep the Ubuntu distribution as up to date as possible — might run into the following issue:

I would like to share this very handy answer written by langioletto that I found on Ask Ubuntu, which resolves this dependency issue.

WARNING: Downgrading packages is dangerous, especially in libraries like OpenSSL. Do not run this in a production environment!

Once SQL Server is installed, you will have to run sudo /opt/mssql/bin/mssql-conf setup to make sure SQL Server is configured correctly. Fortunately, SQL Server 2017 on Linux is non-destructive with any databases you already had from previous installations, so the service should start up happily by itself and all your databases should be usable.

Thanks, langioletto!

Share your Linux development environment tips and tricks with me on Twitter at @bornsql.

5 thoughts on “Repair SQL Server on Linux after an Ubuntu distribution upgrade

  • This is just crazy. Given how Microsoft has said they’re committed to SQL Server on Linux, and how they’ve contributed so much to Ubuntu in particular, I wonder why there is still no update that makes SQL Server 2017 compatible with the 18.04 LTS libraries.

    Fortunately there are always options to those with the fortitude to do crazy things with their development environments 😛

    • What is even more crazy is that it doesn’t support latest 16.04.04 either because of the openssl issue. If you do dist-upgrade it will bump openssl and remove mssql-server package … I had 400 updates and didn’t notice this until my web server went down in fire …

  • Great post Randolph!

    Actually we are new to Ubuntu world so if you elaborate the steps with meaning and purspose please it would be much great

    • Manish, there’s a lot to discuss that would be out of the scope of this comment section. I recommend reading about package management from Ubuntu’s official documentation to get a better understanding of how it all works. Good luck!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: