Stable installations of mssql-cli on Linux are hosted in the Microsoft Linux Software Repository. mssql-cli supports the following Linux distributions:
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
sudo apt-add-repository https://packages.microsoft.com/ubuntu/16.04/prod
# Update the list of products
sudo apt-get update
# Install mssql-cli
sudo apt-get install mssql-cli
# Install missing dependencies
sudo apt-get install -f# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod
# Update the list of products
sudo apt-get update
# Install mssql-cli
sudo apt-get install mssql-cli
# Install missing dependencies
sudo apt-get install -f
apt-transport-httpsis required for importing keys. If not installed, callsudo apt-get install curl apt-transport-https.
# Import the public repository GPG keys
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Product feed
echo "deb [arch=amd64] https://packages.microsoft.com/debian/8/prod jessie main" | sudo tee /etc/apt/sources.list.d/mssql-cli.list
# Update the list of products
sudo apt-get update
# Install mssql-cli
sudo apt-get install mssql-cli
# Install missing dependencies
sudo apt-get install -f# Import the public repository GPG keys
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Product feed
echo "deb [arch=amd64] https://packages.microsoft.com/debian/9/prod stretch main" | sudo tee /etc/apt/sources.list.d/mssql-cli.list
# Update the list of products
sudo apt-get update
# Install mssql-cli
sudo apt-get install mssql-cli
# Install missing dependencies
sudo apt-get install -fAfter registering the Microsoft repository once as superuser,
from then on, you just need to use sudo apt-get upgrade mssql-cli to update it.
To uninstall mssql-cli, call sudo apt-get remove mssql-cli.
This package also works on Oracle Linux 7.
# Import the public repository GPG keys
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft product feed
curl https://packages.microsoft.com/config/centos/7/prod.repo > /etc/yum.repos.d/msprod.repo
# Install dependencies and mssql-cli
sudo yum install libunwind
sudo yum install mssql-cli# Import the public repository GPG keys
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft product feed
curl https://packages.microsoft.com/config/centos/8/prod.repo > /etc/yum.repos.d/msprod.repo
# Install dependencies and mssql-cli
sudo yum install libunwind
sudo yum install mssql-cli# Import the public repository GPG keys
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft product feed
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo
# Install dependencies and mssql-cli
sudo yum install libunwind
sudo yum install mssql-cliAfter registering the Microsoft repository once as superuser,
from then on, you just need to use sudo yum update mssql-cli to update it.
To uninstall mssql-cli, call sudo yum remove mssql-cli.