Microsoft just launched SQL Server vNEXT CTP1 for Linux, below is tutorial for installing SQL Server on Ubuntu

Prerequisites:

  1. Internet connection
  2. At least Ubuntu 16.04 64bit

Here’s the steps to install SQL Server on Ubuntu

  1. Import the public repository GPG keys

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

  2. Add Microsoft SQL Server Ubuntu repository

    curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list

  3. Run commands below

    sudo apt-get update

    sudo apt-get install -y mssql-server

  4. Once the installation finish, run the script to install

    sudo /opt/mssql/bin/sqlservr-setup

  5. Once it’s done, register SQL Server services to the system

    systemctl status mssql-server

Install SQL Server Tools

The following steps install the command-line tools, Microsoft ODBC drivers, and their dependencies. The mssql-tools package contains:

  • sqlcmd: Command-line query utility.
  • bcp: Bulk import-export utility.

Install tools on Linux

  1. RHEL

    sudo su

    curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo

    exit

    sudo yum install mssql-tools

  2. Ubuntu

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

    curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

    sudo apt-get update

    sudo apt-get install mssql-tools