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-https
is 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 -f
After 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-cli
After 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
.