MSSQL : SQLCMD not found

6,324

You need to make sure you set up the MSSQL repository for the mssql-tools and then install it. None of the MSSQL stuff is available out of the box.

Caveats:

  • 16.04 is the only available version of Ubuntu supported at the time of this post.

  • Since this post, only LTSes are guaranteed to work, interim releases may work but LTSes are preferred environments.

(Source)

NOTE FROM THOMAS WARD: These are from Microsoft, I don't necessarily endorse all their recommended procedures.

Install tools on Ubuntu

  1. Enter Superuser Mode

    sudo su

  2. Import the public repository GPG keys:

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

  3. Register the Microsoft Ubuntu repository:

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

  4. Exit superuser mode:

    exit

  5. Update the sources list and run the installation command:

    sudo apt-get update
    sudo apt-get install mssql-tools
Share:
6,324

Related videos on Youtube

chandra sekhar madepalli
Author by

chandra sekhar madepalli

Updated on September 18, 2022

Comments

  • chandra sekhar madepalli
    chandra sekhar madepalli almost 2 years

    I am unable to install mssql-tools

    sudo apt-get install mssql-tools
    

    It gives the error:

    E: unable to locate
    

    How can I fix this?

    • TheOdd
      TheOdd over 7 years
      Just to confirm, but you are trying to install mssql and not mysql right? Also, if it is mssql, are you trying to install a client or are you trying to install server tools?
    • Thomas Ward
      Thomas Ward over 7 years
      @Owen mssql-tools is the tools that provide sqlcmd. They're after the MSSQL tools.