我尝试使用以下命令在 Kali 2019 Linux 上安装 mssql-server 2019:
sudo apt-get install mssql-server
它不起作用,所以我按照 ubuntu 18 的说明进行操作https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15
第一行有效:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
密钥是添加了,但是第二行不起作用:
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
所以我执行了 vi /etc/apt/sources.list 并添加了我从中获取的行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
并以 root 身份发出:
apt-get install -y mssql-server
并且成功了!
然后我从以下位置配置了服务器:
sudo /opt/mssql/bin/mssql-conf
如果您是 root,则不需要 sudo。
它也确实起作用了,并且设置了管理员密码
该服务现在正在运行:
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]
但是这样做的后果如何呢?在 Kali 2019 上安装 MS SQL 2019。
它会崩溃吗,我确实让我的电脑运行 Kali VM,但是我有一个 Windows 更新重新启动并清理了所有内容,并且 Kali 异常关闭,然后我重新启动 Kali 来处理它,它很好,我需要检查工具是否也安装了。
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
它还成功将 prod.list 下载到 /etc/apt/sources.list.d/msprod.list
我从 MS 文档中运行了以下命令:
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
然后我收到这个错误:
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.
有没有什么办法可以解决这个问题?
谢谢
答案1
MSSQL 实际上仅支持特定版本的 ubuntu、suse 和 redhat。混合使用软件包来尝试让其正常工作大概是让它运行的最糟糕的选择,因为你可能会破坏你的 Kali 安装
Kali 似乎支持码头工人- 还有预构建的 Docker 镜像。您可能可以在单独的容器中运行需要与其对话的任何内容。