ubuntu – 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-server

it didn’t work, so I followed ubuntu 18 instructions on https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15

the first line worked:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

the key was added, but the second line didn’t work:

sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"

so I did vi /etc/apt/sources.list and added the line in which I took from https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list

deb (arch=amd64,arm64,armhf) https://packages.microsoft.com/ubuntu/18.04/mssql-server-2019 bionic main

and issued as root:

apt-get install -y mssql-server

and 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: https://docs.microsoft.com/en-us/sql/linux
 Main PID: 4345 (sqlservr)
    Tasks: 123
   Memory: 752.8M
   CGroup: /system.slice/mssql-server.service
           ├─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 https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

it 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-dev

then 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