I'm excited to see the release of 18.04.
My build needs the ability to connect to a MSSQL server running on Ubuntu 18.04 via PHP.
Has a repo been released for mssql-server on this version of Ubuntu?
I'm excited to see the release of 18.04.
My build needs the ability to connect to a MSSQL server running on Ubuntu 18.04 via PHP.
Has a repo been released for mssql-server on this version of Ubuntu?
https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017 so far only mentions 16.04.
The mssql-server package from the repo there works fine in Ubuntus up to 17.10, but after 18.04 it no longer installs due to outdated dependencies.
But we can still install and run it :-) First we add the repo:
$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
$ echo 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017 xenial main' | sudo tee -a /etc/apt/sources.list.d/mssql-server.list
Then we install the dependencies:
$ sudo apt install openssl1.0 libcurl4 libjemalloc2 libc++1 libsss-nss-idmap0 libc++abi1
$ # Mark them as dependencies so they're autoremoved if you remove mssql-server:
$ sudo apt-mark auto openssl1.0 libcurl4 libjemalloc2 libc++1 libsss-nss-idmap0 libc++abi1
Then we fix the dependency list in the .deb to specify openssl1.0 instead of openssl:
$ mkdir tmp && cd tmp
$ sudo apt download mssql-server
$ ar x mssql-server_14.0.3025.34-3_amd64.deb
$ emacs -Q control.tar.gz
In Emacs:
control in the file listingopenssl1.0 instead of openssl (note: it's mentioned two places in the same line),libjemalloc2 instead of libjemalloc1,Save and then the X to the left of Save,Save in the file listing,Then we repack the archive under a new name and install it:
$ # Note: order of arguments matters here:
$ ar rcs mssql-server_14.0.3025.34-3fixed_amd64.deb debian-binary control.tar.gz data.tar.xz
$ sudo dpkg -i mssql-server_14.0.3025.34-3fixed_amd64.deb
Now just continue from step 4 (mssql-conf setup) of https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017 and you should be able to test your connection with e.g. sqsh or tsql.
EDIT: I've got my current script for doing this on Ubuntu 19.10 here: https://gist.github.com/unhammer/6bff7adabb98e581508c042dc1fb9914
libcurl3 and libcurl4 are in conflict, and packages like curl ǹow depend on libcurl4. I'll update the answer.
– unhammer
May 15 '18 at 13:39