11

I am trying to install MSSQL-Server on my Ubuntu 22.04. I know that it does not currently support Ubuntu 22.04. I need to find a workaround to install the software as I don't want to downgrade.

I tried installing but it keeps giving me dependency errors. How do I solve it? Any help would be appreciated.

hawaee
  • 137
  • 1
  • 1
  • 4
  • 1
    Have you considered Docker? – AlwaysLearning May 30 '22 at 04:18
  • try a VM or try Docker AS @AlwaysLearning explained https://hub.docker.com/_/microsoft-mssql-server – isatsara May 30 '22 at 09:18
  • No I have not. What is Docker? – hawaee May 30 '22 at 16:26
  • 1
    [Docker](https://www.docker.com/) is a virtualization system for delivering and compartmentalizing software systems into containers that operate separately from the host operating system, e.g.: you could have multiple Ubuntu containers of different versions running concurrently and independently on your choice of a Linux/macOS/Windows host. Microsoft makes SQL Server 2017 and SQL Server 2019 available in a [Docker container](https://hub.docker.com/_/microsoft-mssql-server) that can run on an Ubuntu 22.04 host even though the container itself is running SQL Server 2019 on a Ubuntu 20.04 kernel. – AlwaysLearning May 31 '22 at 06:57

3 Answers3

17

Unfortunately, at this time, SQL Server 2019 only works on Ubuntu 20/21. 22.04 is not supported at this time.

So either you will have to use Ubuntu 20 or, as others have stated, use Docker Containers.

You can install Docker into Ubuntu 22.04. It's a multi-step process, but it isn't that difficult.

  1. Install Docker Engine on Ubuntu (follow the Install using the repository section) 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&pivots=cs1-bash

That should do it.

Also, in link #2, read further below on how to connect to your docker image to run SQLCMD from within the container.

Like SQL Server 2019, you cannot install the SQLCMD tools directly into your Ubuntu 22.04 installation. But the Docker container image contains the sqlcmd tool for you to be able to connect to the database.

Or, you can use Visual Studio Code with the SQL Server (mssql) extension and it can connect to your SQL Server instance in your running Docker container.

The connection string would be:

"Server=localhost;Database=your database name;User Id=user id;Password=password"

You can leave out the Database setting if you just want to connect to the default database.

If you create any databases, you can then connect to them directly by specifying the name.

bolski
  • 518
  • 4
  • 19
  • 1
    This works great and helped me learn basics of using docker. Thanks for creating a complete solution and including valid links. – raddevus Mar 07 '23 at 15:21
1

I also have same problem like this. I also tried downgrading Openssl to 1.1.1k and 1.1.1s but still not works. And finally I found this explanation

https://github.com/microsoft/msphpsql/issues/1419#issuecomment-1303626500

So, keep use OpenSSL 3.0.2 and you just need to change the SECLEVEL to 0 instead of 1 in /etc/ssl/openssl.conf

[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=0

And it works, now I can connect to SQL Server using Ubuntu 22.04.

Dolly Aswin
  • 2,684
  • 1
  • 20
  • 23
-3

Looked at this and it has worked for me!

So worth giving it a shot

cd /opt/mssql/lib
ls -la
sudo rm libcrypto.so libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.1.1

If libssl is not installed, try:

sudo apt install libssl1.1

Update: I had issues connecting using libssl1.1, so I switched to 1.0 after performing the previous steps, so I also did the following:

sudo systemctl stop mssql-server
sudo systemctl edit mssql-server 

Added:

[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"

Then:

sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so

Then started mysql-server and things just worked fine!

Roham
  • 20
  • 3