MSSQL on Ubuntu, can't get it to install?

29,081

Solution 1

You will need a 64-bit system for this to work ;)

First, add the Xenial MSSQL repository to your system:

$ sudo curl -o /etc/apt/sources.list.d/mssql-server.list https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    91  100    91    0     0    195      0 --:--:-- --:--:-- --:--:--   195
$ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   2337      0 --:--:-- --:--:-- --:--:--  2340
OK

Second, update APT's list of available packages:

$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/numix/ppa/ubuntu yakkety InRelease
Get:2 http://security.ubuntu.com/ubuntu yakkety-security InRelease [93,3 kB]   
Hit:3 http://nl.archive.ubuntu.com/ubuntu yakkety InRelease                    
Hit:4 http://nl.archive.ubuntu.com/ubuntu yakkety-updates InRelease            
Hit:5 http://nl.archive.ubuntu.com/ubuntu yakkety-backports InRelease          
Get:6 https://packages.microsoft.com/ubuntu/16.04/mssql-server xenial InRelease [2828 B]
Get:7 https://packages.microsoft.com/ubuntu/16.04/mssql-server xenial/main amd64 Packages [940 B]
Fetched 97,1 kB in 0s (204 kB/s)  
Reading package lists... Done

Optionally, you can check that it's ready to install:

$ apt-cache search mssql-server
mssql-server - Microsoft SQL Server Relational Database Engine
mssql-server-agent - Microsoft SQL Server Agent
mssql-server-fts - Microsoft SQL Server Full Text Search.
mssql-server-ha - The mssql-server-ha package contains HA extensions for the Microsoft SQL Server Relational Database Engine.
mssql-server-is - SSIS on Linux

Then, just install with sudo apt install mssql-server.

Solution 2

I seached and finally found a working solution:

Installation

The first thing to do is import the necessary repository key. From the terminal window, issue the following command:

sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Next, add the repository with the command:

sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-preview.list)"

Update the APT database with the command:

sudo apt-get update

And, finally, install MS SQL with the command:

sudo apt-get install mssql-server -y
Share:
29,081

Related videos on Youtube

DocPanic
Author by

DocPanic

Updated on September 18, 2022

Comments

  • DocPanic
    DocPanic almost 2 years

    Recently MS launched mssql-server for Linux. I'd like to use it but I can't manange to run

    sudo apt-get install -y mssql-server
    

    It says

    E: Unable to locate package mssql-server
    

    Current Ubuntu is 16.04.1 LTS.

    I tried to follow [these instructions on Microsoft's website]( https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-ubuntu) and don't know what else to do with it.

    • Rinzwind
      Rinzwind over 7 years
      why would there be an mssql package in your 16.04 install? that package is not from Canonical. You need to do the curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-ser‌​ver.list > /etc/apt/sources.list.d/mssql-server.list and update.
    • DocPanic
      DocPanic over 7 years
      i did follow and do this like i mentioned on my post. After looking inside its list, the arch is for amd64, im running 32 bit(i386), would that be a problem?
    • Rinzwind
      Rinzwind over 7 years
      yes, you will need a 64 bit system. Doubt MS wants to support 32 bit ;)
    • DocPanic
      DocPanic over 7 years
      lol and here i was trying to run a experiment with pentium 4... oh wellll guess its time to trash thissss :P
    • Thomas Ward
      Thomas Ward over 7 years
    • DocPanic
      DocPanic over 7 years
      true but this was the first topic about the issue :)
  • userfuser
    userfuser over 6 years
    Precisely, you'll need AMD64 system. It won't work on ARM architecture (at least not yet).
  • Hack-R
    Hack-R over 6 years
    Link is broken I believe
  • Edgar Froes
    Edgar Froes over 5 years
    I was getting Full-Text error on a docker container with the latest image from microsoft/mssql-server-linux, I logged into the container terminal and couldn't execute apt-get install -y mssql-server-fts, this answear was all I needed. Thanks!
  • Rakibul hasan
    Rakibul hasan almost 5 years
    Welcome to Ask Ubuntu, while this link may answer the question, it's better to include essential parts here.
  • pyeR_biz
    pyeR_biz over 4 years
    I think this is the best package install post I have come across. Check that it's ready to install is my favorite part.
  • Dave Pile
    Dave Pile over 3 years
    Thank you. The first step adding the keys was what I was needing