Installing SQL Server Tools On Ubuntu 18.04 Linux System - Step by Step
Installing SQL Server Tools On Ubuntu 18.04 Linux System - Step by Step
How to create a virtual machine and install Ubuntu 18.04 Linux server
How to install SQL Server 2019 on Ubuntu 18.04 Server
Thus, I have already installed SQL Server 2019 on Ubuntu 18.04 and shown its connectivity through
SQL Server Management Studio from a remote server.
If you want to connect to SQL Server instances locally on the Ubuntu Linux server, we first need to
install the SQL Server command-line tools. These tools include sqlcmd and bcp utilities:
SQLCMD is a popular command-line utility that we use to establish SQL Server connections to
execute queries.
BCP is one of the SQL Server utilities that serve to process the import and export of data.
The role of these SQL Server tools is crucial when if it comes to Linux-based SQL Server instances.
They are very helpful for establishing the SQL Server connection or executing any query locally on
the Linux server.
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 1/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
I would recommend you checking and validating the SQL Server service on this Linux machine
whether our installed version of SQL Server is running fine or not.
Open the Ubuntu terminal screen and connect to the server. Run the below command to get the status
of the running SQL Server instance:
See the output – our SQL Server is running fine on our target system:
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 2/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
Note: If you are using a different version of Ubuntu, make sure to change the repository path. For
instance, if you are using Ubuntu 20.04, change the repository path
from /ubuntu/18.04 to /ubuntu/20.04.
Now, we are updating the source list of packages by executing the below command:
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 3/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
The screen will show all 37 packages to be installed. The system will check the required disk space for
this installation and ask for your consent to proceed: enter Y for installation or enter n to abort the
process.
Once you have chosen to go ahead with this installation, the terminal screen will show the next series
of execution.
The next screen is named Package configuration. It will allow you to configure and accept the license
terms for the Microsoft ODBC driver for Linux-based SQL Server.
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 4/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
Note: If you are facing any issues while installing this ODBC package, check and verify the existing
version of your msodbcsql package. If you installed its version v17 that was briefly available, remove
it before installing the msodbcsql17 package. This way, you will avoid conflicts.
As we can see, the package name is msodbcsql17. Now, we will accept the license terms of this
package and proceed with this installation by choosing Yes and pressing Enter.
Now, accept the license terms for mssql-tools package on the following screen. Again, select Yes and
click Enter:
The new screen will appear to execute other packages once you accept the license terms from the
above screen.
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 5/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
You can see all packages in the process of setting up and configured in the below screen. The last few
lines show that the mssql-tools package has been set up successfully:
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 6/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 7/8
5/12/21 20:10 Installing SQL Server Tools on Ubuntu 18.04 Linux System - Step by Step
--Run below command to use SQL Server Tools from the bash shell for login
sessions
--Modify the PATH in the ~/.bash_profile file
--Run below command to use SQL Server Tools from the bash shell for
interactive/non-login sessions
source ~/.bashrc
Now, after executing the above two commands, Ubuntu has recognized SQLCMD.
https://codingsight.com/installing-sql-server-tools-on-ubuntu-18-04-linux-system-step-by-step/ 8/8