Software & AppsOperating SystemLinux

How To Install MS SQL on Ubuntu 18.04 LTS

Ubuntu 8

In this article, we will guide you through the steps of installing Microsoft SQL Server (MS SQL) on Ubuntu 18.04 LTS. Although Microsoft does not officially support this, there are workarounds that can enable you to run MS SQL on Ubuntu 18.04 LTS. Please note that this workaround is recommended for testing purposes only.

Prerequisites

Before we get started, you need to have:

  • Ubuntu 18.04 LTS installed on your machine.
  • Access to a terminal window/command line (Ctrl-Alt-T).
  • Sudo or root privileges.

Step 1: Download MS SQL Server Package for Ubuntu 16.04

Since Microsoft does not provide a package for Ubuntu 18.04, we will download the package intended for Ubuntu 16.04. You can download it from the Microsoft website.

In your terminal, navigate to the directory where you want to download the package and use the wget command:

wget https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017/pool/main/m/mssql-server/mssql-server_14.0.3192.2-2_amd64.deb

This command downloads the MS SQL Server package for Ubuntu 16.04.

Step 2: Unpack the Downloaded Package

Next, we need to unpack the downloaded package. We will use the dpkg-deb command for this:

dpkg-deb -x mssql-server_14.0.3192.2-2_amd64.deb mssql-server

The -x parameter extracts the files from the package.

Step 3: Modify the Control File

After unpacking the package, we need to modify the control file to change the OpenSSL dependency. Navigate to the control file directory:

cd mssql-server/DEBIAN

Open the control file using a text editor, such as nano:

nano control

In the control file, find the line that says openssl (<= 1.1.0). Change it to openssl (<= 1.1.1). Save and close the file.

Step 4: Repackage the Modified Package

Now we will repackage the modified files into a new .deb package. Navigate back to the directory where the unpacked files are located and use the dpkg-deb command:

dpkg-deb -b mssql-server mssql-server-modified.deb

The -b parameter builds a new package.

Step 5: Install the Modified Package

Attempt to install the modified package using the dpkg command:

dpkg -i mssql-server-modified.deb

The -i parameter installs the package. This will initially fail due to missing dependencies.

Step 6: Install Missing Dependencies

To install the missing dependencies, use the apt command:

apt-get install -f

The -f parameter fixes broken dependencies.

Step 7: Retry Installing the Modified Package

Now retry the installation of the modified package:

dpkg -i mssql-server-modified.deb

Step 8: Set Up MS SQL Server

Follow the instructions provided by the package to set up MS SQL Server. You can start the setup with the following command:

/opt/mssql/bin/mssql-conf setup

Congratulations! You have successfully installed MS SQL Server on Ubuntu 18.04 LTS. Remember, this is a workaround and not officially supported by Microsoft. Always ensure to have proper backups of your data and consider using other officially supported databases on Ubuntu 18.04, such as MySQL.

Can I install MS SQL Server on Ubuntu 18.04 LTS?

Yes, you can install MS SQL Server on Ubuntu 18.04 LTS by following the steps outlined in this article.

Is installing MS SQL Server on Ubuntu 18.04 LTS officially supported by Microsoft?

No, installing MS SQL Server on Ubuntu 18.04 LTS is not officially supported by Microsoft. This workaround is recommended for testing purposes only.

What are the prerequisites for installing MS SQL Server on Ubuntu 18.04 LTS?

The prerequisites for installing MS SQL Server on Ubuntu 18.04 LTS include having Ubuntu 18.04 LTS installed on your machine, access to a terminal window/command line, and sudo or root privileges.

Where can I download the MS SQL Server package for Ubuntu 16.04?

You can download the MS SQL Server package for Ubuntu 16.04 from the Microsoft website. The download link is provided in Step 1 of this article.

What should I do if the installation initially fails due to missing dependencies?

If the installation fails due to missing dependencies, you can use the apt-get install -f command to install the missing dependencies. This command is explained in Step 6 of this article.

Can I use this workaround for production purposes?

No, this workaround is recommended for testing purposes only. It is not recommended to use this workaround for production purposes. Always ensure to have proper backups of your data and consider using other officially supported databases on Ubuntu 18.04, such as MySQL.

Leave a Comment

Your email address will not be published. Required fields are marked *