10

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.

6
  • 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-server.list > /etc/apt/sources.list.d/mssql-server.list and update.
    – Rinzwind
    Nov 17 '16 at 21:14
  • 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?
    – DocPanic
    Nov 18 '16 at 18:06
  • 1
    yes, you will need a 64 bit system. Doubt MS wants to support 32 bit ;)
    – Rinzwind
    Nov 18 '16 at 18:09
  • lol and here i was trying to run a experiment with pentium 4... oh wellll guess its time to trash thissss :P
    – DocPanic
    Nov 18 '16 at 18:12
  • Possible duplicate of How do I install MSSQL Server and/or tools for Linux on 16.04?
    – Thomas Ward
    Nov 18 '16 at 19:37
14

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.

4
  • Precisely, you'll need AMD64 system. It won't work on ARM architecture (at least not yet).
    – userfuser
    Oct 26 '17 at 18:08
  • Link is broken I believe
    – Hack-R
    Mar 26 '18 at 17:21
  • 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! Nov 10 '18 at 2:28
  • I think this is the best package install post I have come across. Check that it's ready to install is my favorite part.
    – pyeR_biz
    Nov 22 '19 at 22:52
3

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
2
  • Welcome to Ask Ubuntu, while this link may answer the question, it's better to include essential parts here.
    – user833907
    Aug 4 '19 at 2:57
  • Thank you. The first step adding the keys was what I was needing
    – Dave Pile
    Feb 2 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.