SQL SERVER ON LINUX INSTALLATION – PART3 – Install SQL Server on Ubuntu

In last two parts of this series, I discussed how to create a virtual machine using Windows Hyper-V and how to install Ubuntu Server on the created virtual machine. In this post, we shall be installing SQL Server on the Ubuntu Server, but before we start installing the SQL server,  I would like to share my experience with SSOL.

My experience:

Since SQL Server on Linux public preview has been announced, I have been exploring it a lot. One of my the best experience with SQL Server on Linux, the installation process takes less than 60 seconds (Yes, you heard me correctly 🙂 ) to get completed and it is also very easy to install.

Let’s explore a step by step installation of SQL Server on Linux machine;

  • Connect to the Linux virtual machine and log on to the server by keying username and password

01connecttolinuxmachine

  • Switch to root user (superuser)

Syntax: sudo su

02switchrootuser

  • Check you can access the internet on your Linux virtual machine by pinging www.google.com

Syntax: ping www.google.com

03checkinternetaccess

  •  Install the Microsoft GPG keys into the Ubuntu Server by the following script

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

04public-repository-gpg

  • Register SQL Server repository into the Ubuntu Server by running following script

Syntax: curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list > /etc/apt/sources.list.d/mssql-server.list

5ubunturepository

  • Exit from superuser mode

Syntaxexit

06exitsuperuser

  • Now, it’s time to install SQL Server by using the following scripts

1) You need to run the below script to get all the latest updates from Ubuntu & Microsoft online servers

Syntax: sudo apt-get update

07aptgetupdate

2) Install the SQL Server on Linux

Syntax: sudo apt-get install -y mssql-server

08sqlinstallation

  • Once SQL Server installation completed successfully, kindly run the configuration script. During the configuration setup, It will ask you to;
    • Accept license terms
    • Key “sa” password
    • Start the SQL Server Service
    • Enable the SQL Server Service on the server reboot

Syntax: sudo /opt/mssql/bin/mssql-conf setup

09configurationscript_v1

  • Now verify, whether the SQL Server instance is running on Ubuntu Server or not.

Syntax: systemctl status mssql-server

10verifythesqlservice

 Hope, you enjoyed installing a long waited SQL Server on Linux.  In the fourth part of this series, we will perform installation of MSSQL Tools.

3 thoughts on “SQL SERVER ON LINUX INSTALLATION – PART3 – Install SQL Server on Ubuntu

  • Nagaraju Kadiyala

    After executing the below step i got below error. Could youp lease help on this?

    Syntax: sudo apt-get update

    Reply
    • Dharmendra

      When you run the command “sudo apt-get update”, it actually connects to Ubuntu & Microsoft online servers. It generally fails, if your system is not connected to internet. May you please check that you are able to ping google.com from your machine? Can you also paste the error here which you are getting?

      Reply
  • Nagaraju Kadiyala

    Error details:

    Reading package Lists…Done

    w: The repositiory ‘cdrom://Ubuntu-server 16.04.1 LTS _Xenial Xerus_ – Release amd64 (20160719) xenial Release does not have a release file.
    N: Data from such repositiry can’t be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: Failed to fetch cdrom://Ubuntu-server 16.04.1 LTS _Xenial Xerus_ – Release amd64 (20160719)/dists/xenial/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized byt APT. apt-get update cannot be used to add new CD-ROMs
    E: Some index files to download. they have been ignored, or old ones used instead.

    Reply

Leave a comment

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