| author | rwestMSFT | |
|---|---|---|
| ms.author | randolphwest | |
| ms.date | 08/12/2025 | |
| ms.service | sql | |
| ms.topic | include | |
| ms.custom |
|
Use the following steps to install the mssql-tools18 on Ubuntu.
- Ubuntu 24.04 is supported in preview starting with [!INCLUDE sssql25-md].
- Ubuntu 22.04 is supported starting with [!INCLUDE sssql22-md] CU 10.
- Ubuntu 20.04 is supported starting with [!INCLUDE sssql19-md] CU 10.
- Ubuntu 18.04 is supported starting with [!INCLUDE sssql19-md] CU 3.
-
Enter superuser mode.
sudo su
-
Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc -
Register the Microsoft Ubuntu repository.
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list -
Exit superuser mode.
exit
-
Enter superuser mode.
sudo su
-
Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc -
Register the Microsoft Ubuntu repository.
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list -
Exit superuser mode.
exit
-
Enter superuser mode.
sudo su
-
Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc -
Register the Microsoft Ubuntu repository.
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list -
Exit superuser mode.
exit
Use the following steps to install the mssql-tools18 for [!INCLUDE sssql25-md] on Ubuntu 24.04 in preview.
-
Enter superuser mode.
sudo su
-
Register the Microsoft repository for Ubuntu 24.04.
curl -sSL -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
-
Install the repository package:
sudo dpkg -i packages-microsoft-prod.deb
-
Exit superuser mode.
exit
-
Update the sources list and run the installation command with the unixODBC developer package.
sudo apt-get update sudo apt-get install mssql-tools18 unixodbc-dev
To update to the latest version of mssql-tools, run the following commands:
sudo apt-get update sudo apt-get install mssql-tools18
-
Optional: Add
/opt/mssql-tools18/bin/to yourPATHenvironment variable in a bash shell.To make sqlcmd and bcp accessible from the bash shell for login sessions, modify your
PATHin the~/.bash_profilefile with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile source ~/.bash_profile
To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the
PATHin the~/.bashrcfile with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc