How to install mssql-server on Kali Linux
I tried to install mssql-server 2019 on Kali 2019 Linux using:
sudo apt-get install mssql-serverit didn't work, so I followed ubuntu 18 instructions on
the first line worked:
wget -qO- | sudo apt-key add -the key was added, but the second line didn't work:
sudo add-apt-repository "$(wget -qO- )"so I did vi /etc/apt/sources.list and added the line in which I took from
deb [arch=amd64,arm64,armhf] bionic mainand issued as root:
apt-get install -y mssql-serverand it worked!
then I configured the server from:
sudo /opt/mssql/bin/mssql-conf you don't need sudo if you are root.
also it did work and the administrator password was set
the service is running now:
root@kali:/etc/apt# systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor pre Active: active (running) since Wed 2021-06-09 19:40:15 EDT; 17s ago Docs: Main PID: 4345 (sqlservr) Tasks: 123 Memory: 752.8M CGroup: / ├─4345 /opt/mssql/bin/sqlservr └─4375 /opt/mssql/bin/sqlservr
Jun 09 19:40:23 kali sqlservr[4345]: [78B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [84B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [145B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [96B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [66B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [75B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [96B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [100B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [124B blob data]
Jun 09 19:40:23 kali sqlservr[4345]: [71B blob data]but what about the consequences of doing so, installing MS SQL 2019 on Kali 2019.
is it going to crash, I did leave my computer with Kali VM running but I had a windows update that restarted and cleaned everything and Kali was abnormally shutdown, then I restarted Kali to work on it, it's fine, I need to check the tools if it also installs.
curl | sudo tee /etc/apt/sources.list.d/msprod.listit also successfully downloaded prod.list to /etc/apt/sources.list.d/msprod.list
I ran the following commands from MS documentation:
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-devthen I got this error:
root@kali:/etc/apt# sudo apt-get install mssql-tools unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies: mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed unixodbc-dev : Depends: unixodbc (= 2.3.7) but it is not going to be installed Depends: odbcinst1debian2 (= 2.3.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.is there a way to work around this problem??
thanks
32 Answers
MSSQL is literally only supported on specific versions of ubuntu, suse and redhat.Mixing up packages to try to get things to work is roughly the worst option to get it running cause you'll potentially break your Kali install
Kali does seem to support docker - and there's pre-built docker images. You can probably run whatever needs to talk to it on separate containers.
Sorry for the inconvenience, I have no space to install Docker images for this on the VM and I have been wondering if it’s possible to do that on Kali Linux.
I have successfully installed it and it’s running perfect up to now, I did the following to install the tools:
1- The mssql-server-agent needs to be enabled not installed on MS SQL 2019 as it ships with the box
2- Mssql-server-ssis is renamed to mssql-server-is and installed perfectly
3- Ssms studio is installed only on windows, you can log on remotely from any windows machine to your kali box
root@kali:/etc/apt# apt-get install -y multiarch-support
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed: multiarch-support
0 upgraded, 1 newly installed, 0 to remove and 2116 not upgraded.
Need to get 181 kB of archives.
After this operation, 199 kB of additional disk space will be used.
Get:1 jessie/main amd64 multiarch-support amd64 2.19-18+deb8u10 [181 kB]
Fetched 181 kB in 1s (228 kB/s)
Selecting previously unselected package multiarch-support.
(Reading database ... 404376 files and directories currently installed.)
Preparing to unpack .../multiarch-support_2.19-18+deb8u10_amd64.deb ...
Unpacking multiarch-support (2.19-18+deb8u10) ...
Setting up multiarch-support (2.19-18+deb8u10) ...
root@kali:/etc/apt# apt-get install -y msodbcsql17 unixodbc odbcinst1debian2 libodbc1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed: odbcinst
Suggested packages: unixodbc-bin
The following NEW packages will be installed: msodbcsql17 odbcinst odbcinst1debian2 unixodbc
The following packages will be upgraded: libodbc1
1 upgraded, 4 newly installed, 0 to remove and 2115 not upgraded.
Need to get 1,422 kB of archives.
After this operation, 409 kB of additional disk space will be used.
Get:1 bionic/main amd64 libodbc1 amd64 2.3.7 [511 kB]
Get:2 bionic/main amd64 odbcinst amd64 2.3.7 [12.0 kB]
Get:3 bionic/main amd64 odbcinst1debian2 amd64 2.3.7 [135 kB]
Get:4 bionic/main amd64 unixodbc amd64 2.3.7 [19.6 kB]
Get:5 bionic/main amd64 msodbcsql17 amd64 17.7.2.1-1 [745 kB]
Fetched 1,422 kB in 4s (325 kB/s)
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
(Reading database ... 404380 files and directories currently installed.)
Preparing to unpack .../libodbc1_2.3.7_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.7) over (2.3.6-0.1+b1) ...
Selecting previously unselected package odbcinst.
Preparing to unpack .../odbcinst_2.3.7_amd64.deb ...
Unpacking odbcinst (2.3.7) ...
Selecting previously unselected package odbcinst1debian2:amd64.
Preparing to unpack .../odbcinst1debian2_2.3.7_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.3.7) ...
Selecting previously unselected package unixodbc.
Preparing to unpack .../unixodbc_2.3.7_amd64.deb ...
Unpacking unixodbc (2.3.7) ...
Selecting previously unselected package msodbcsql17.
Preparing to unpack .../msodbcsql17_17.7.2.1-1_amd64.deb ...
Unpacking msodbcsql17 (17.7.2.1-1) ...
Setting up libodbc1:amd64 (2.3.7) ...
Setting up odbcinst1debian2:amd64 (2.3.7) ...
Setting up odbcinst (2.3.7) ...
Setting up unixodbc (2.3.7) ...
Setting up msodbcsql17 (17.7.2.1-1) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for man-db (2.8.6.1-1) ...
root@kali:/etc/apt# sudo apt-get install mssql-tools unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed: autoconf automake autotools-dev libltdl-dev libltdl7 libtool
Suggested packages: autoconf-archive gnu-standards autoconf-doc gettext libtool-doc gfortran | fortran95-compiler gcj-jdk
The following NEW packages will be installed: autoconf automake autotools-dev libltdl-dev libtool mssql-tools unixodbc-dev
The following packages will be upgraded: libltdl7
1 upgraded, 7 newly installed, 0 to remove and 2114 not upgraded.
Need to get 2,519 kB of archives.
After this operation, 7,835 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 kali-rolling/main amd64 autoconf all 2.69-14 [313 kB]
Get:5 bionic/main amd64 mssql-tools amd64 17.7.1.1-1 [212 kB]
Get:2 kali-rolling/main amd64 autotools-dev all 20180224.1+nmu1 [77.1 kB]
Get:3 kali-rolling/main amd64 automake all 1:1.16.3-2 [814 kB]
Get:4 kali-rolling/main amd64 libltdl7 amd64 2.4.6-15 [391 kB]
Get:6 kali-rolling/main amd64 libltdl-dev amd64 2.4.6-15 [162 kB]
Get:7 kali-rolling/main amd64 libtool all 2.4.6-15 [513 kB]
Get:8 bionic/main amd64 unixodbc-dev amd64 2.3.7 [37.1 kB]
Fetched 2,519 kB in 2s (1,034 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
Selecting previously unselected package autoconf.
(Reading database ... 404401 files and directories currently installed.)
Preparing to unpack .../0-autoconf_2.69-14_all.deb ...
Unpacking autoconf (2.69-14) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../1-autotools-dev_20180224.1+nmu1_all.deb ...
Unpacking autotools-dev (20180224.1+nmu1) ...
Selecting previously unselected package automake.
Preparing to unpack .../2-automake_1%3a1.16.3-2_all.deb ...
Unpacking automake (1:1.16.3-2) ...
Preparing to unpack .../3-libltdl7_2.4.6-15_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.6-15) over (2.4.6-9) ...
Selecting previously unselected package libltdl-dev:amd64.
Preparing to unpack .../4-libltdl-dev_2.4.6-15_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.6-15) ...
Selecting previously unselected package libtool.
Preparing to unpack .../5-libtool_2.4.6-15_all.deb ...
Unpacking libtool (2.4.6-15) ...
Selecting previously unselected package mssql-tools.
Preparing to unpack .../6-mssql-tools_17.7.1.1-1_amd64.deb ...
Unpacking mssql-tools (17.7.1.1-1) ...
Selecting previously unselected package unixodbc-dev.
Preparing to unpack .../7-unixodbc-dev_2.3.7_amd64.deb ...
Unpacking unixodbc-dev (2.3.7) ...
Setting up autotools-dev (20180224.1+nmu1) ...
Setting up mssql-tools (17.7.1.1-1) ...
Setting up libltdl7:amd64 (2.4.6-15) ...
Setting up autoconf (2.69-14) ...
Setting up automake (1:1.16.3-2) ...
update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode
Setting up libtool (2.4.6-15) ...
Setting up libltdl-dev:amd64 (2.4.6-15) ...
Setting up unixodbc-dev (2.3.7) ...
Processing triggers for man-db (2.8.6.1-1) ...
Processing triggers for libc-bin (2.28-10) ...
root@kali:/etc/apt# echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
root@kali:/etc/apt# echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
root@kali:/etc/apt# source ~/.bashrc
root@kali:/etc/apt# sqlcmd -S localhost -U SA -P 'Orient@123'
1> exit
root@kali:/etc/apt# sqlcmd -S localhost -U SA
Password:
1>
2>
3> exit
root@kali:/etc/apt# apt-get install -y mssql-server-fts
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed: mssql-server-fts
0 upgraded, 1 newly installed, 0 to remove and 2114 not upgraded.
Need to get 242 MB of archives.
After this operation, 581 MB of additional disk space will be used.
Get:1 bionic/main amd64 mssql-server-fts amd64 15.0.4123.1-5 [242 MB]
Fetched 242 MB in 1min 54s (2,131 kB/s)
Selecting previously unselected package mssql-server-fts.
(Reading database ... 404727 files and directories currently installed.)
Preparing to unpack .../mssql-server-fts_15.0.4123.1-5_amd64.deb ...
Unpacking mssql-server-fts (15.0.4123.1-5) ...
Setting up mssql-server-fts (15.0.4123.1-5) ...
+-------------------------------------------------------------------------------------+
Please restart mssql-server to enable Microsoft SQL Server Full Text Search.
+-------------------------------------------------------------------------------------+
root@kali:/etc/apt# sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
SQL Server needs to be restarted in order to apply this setting. Please run
'systemctl restart mssql-server.service'.
root@kali:/etc/apt# sudo systemctl restart mssql-server
root@kali:/etc/apt# sudo apt-get install -y mssql-server-is
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed: mssql-server-is
0 upgraded, 1 newly installed, 0 to remove and 2114 not upgraded.
Need to get 228 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 bionic/main amd64 mssql-server-is amd64 15.0.4063.15-88 [228 MB]
Fetched 228 MB in 1min 45s (2,165 kB/s)
Selecting previously unselected package mssql-server-is.
(Reading database ... 404733 files and directories currently installed.)
Preparing to unpack .../mssql-server-is_15.0.4063.15-88_amd64.deb ...
Unpacking mssql-server-is (15.0.4063.15-88) ...
Setting up mssql-server-is (15.0.4063.15-88) ...
+--------------------------------------------------------------------------------+
Please run 'sudo /opt/ssis/bin/ssis-conf setup'
to complete the setup of Microsoft SQL Server Integration Services
+--------------------------------------------------------------------------------+
root@kali:/etc/apt# sudo /opt/ssis/bin/ssis-conf setup
Choose an edition of SQL Server: 1) Evaluation (free, no production use rights, 180-day limit) 2) Developer (free, no production use rights) 3) Express (free) 4) Web (PAID) 5) Standard (PAID) 6) Enterprise (PAID) 7) Enterprise Core (PAID) 8) I bought a license through a retail sales channel and have a product key to enter.
Details about editions can be found at
Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.
Enter your edition(1-8): 2
The license terms for this product can be downloaded from:
The privacy statement can be viewed at:
Do you accept the license terms? [Yes/No]:Yes
Setup has completed successfully.thanks for the understanding, and this was a good experience to me to interact with you on this channel.
I will be monitoring in the few days the performance of MS SQL 2019 on Kali as a Debian flavor of Linux Distros.
I then installed the Powershell core to communicate and automate the MS SQL tasks.
root@kali:/etc/apt# apt-get -y update
Ign:2 jessie InRelease
Hit:3 jessie Release
Hit:1 kali-rolling InRelease
Hit:5 bionic InRelease
Hit:6 bionic InRelease
Reading package lists... Done
root@kali:/etc/apt# apt-get install -y snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed: snapd
0 upgraded, 1 newly installed, 0 to remove and 2112 not upgraded.
Need to get 13.3 MB of archives.
After this operation, 56.4 MB of additional disk space will be used.
Get:1 kali-rolling/main amd64 snapd amd64 2.49-1+b1 [13.3 MB]
Fetched 13.3 MB in 7s (1,837 kB/s)
Selecting previously unselected package snapd.
(Reading database ... 404772 files and directories currently installed.)
Preparing to unpack .../snapd_2.49-1+b1_amd64.deb ...
Unpacking snapd (2.49-1+b1) ...
Setting up snapd (2.49-1+b1) ...
snapd.recovery-chooser-trigger.service is a disabled or a static unit, not starting it.
snapd.seeded.service is a disabled or a static unit, not starting it.
snapd.service is a disabled or a static unit, not starting it.
snapd.socket is a disabled or a static unit, not starting it.
Processing triggers for mime-support (3.63) ...
Processing triggers for gnome-menus (3.32.0-1) ...
Processing triggers for man-db (2.8.6.1-1) ...
Processing triggers for dbus (1.12.16-1) ...
Processing triggers for desktop-file-utils (0.24-1) ...
root@kali:/etc/apt# apt-get install -y git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed: git-man
Suggested packages: git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following packages will be upgraded: git git-man
2 upgraded, 0 newly installed, 0 to remove and 2110 not upgraded.
Need to get 7,355 kB of archives.
After this operation, 4,467 kB disk space will be freed.
Get:1 kali-rolling/main amd64 git amd64 1:2.30.2-1 [5,527 kB]
Get:2 kali-rolling/main amd64 git-man all 1:2.30.2-1 [1,827 kB]
Fetched 7,355 kB in 5s (1,454 kB/s)
apt-listchanges: Reading changelogs...
(Reading database ... 404845 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.30.2-1_amd64.deb ...
Unpacking git (1:2.30.2-1) over (1:2.23.0~rc1-1) ...
Preparing to unpack .../git-man_1%3a2.30.2-1_all.deb ...
Unpacking git-man (1:2.30.2-1) over (1:2.23.0~rc1-1) ...
Setting up git-man (1:2.30.2-1) ...
Setting up git (1:2.30.2-1) ...
Processing triggers for man-db (2.8.6.1-1) ...
root@kali:/etc/apt# snap install powershell --classic
error: cannot communicate with server: Post "": dial unix /run/snapd.socket: connect: no such file or directory
root@kali:/etc/apt# systemctl enable --now snapd apparmor
Synchronizing state of apparmor.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apparmor
Created symlink /etc/systemd/system/ → /lib/systemd/system/snapd.service.
Created symlink /etc/systemd/system/ → /lib/systemd/system/apparmor.service.
root@kali:/etc/apt# snap install powershell --classic
2021-06-09T21:45:04-04:00 INFO Waiting for automatic snapd restart...
Warning: /snap/bin was not found in your $PATH. If you've not restarted your session since you installed snapd, try doing that. Please see for more details.
powershell 7.1.3 from Microsoft PowerShell✓ installed
root@kali:/etc/apt# snap install vim --classic
error: snap "vim" not found
root@kali:/etc/apt# vim
root@kali:/etc/apt# code --help
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please specify an alternate user data directory using the `--user-data-dir` argument.
root@kali:/etc/apt# code --user-data-dirnow I can see the Powershell code from Visual Studio Code.
thanks and regards.