如何在 UBUNTU 18 LTS 上安装 mssql-cli?

如何在 UBUNTU 18 LTS 上安装 mssql-cli?

我在全新的 UBUNTU 18 LTS 中使用apt install mssql-cli,即使在使用后这个答案mssql-server安装成功)和 另一个(执行所有命令),存在“未满足的依赖关系”,

apt install mssql-cli

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-cli : Depends: libicu52 but it is not installable or
                      libicu55 but it is not installable or
                      libicu57 but it is not installable
E: Unable to correct problems, you have held broken packages.

笔记

类似的问题如下apt install powershell

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:
 powershell : Depends: libcurl3 but it is not going to be installed
              Depends: libicu55 but it is not installable
E: Unable to correct problems, you have held broken packages.

垃圾场

/etc/apt/sources.list.d/microsoft.list

 deb [arch=amd64] https://packages.microsoft.com/ubuntu/17.10/prod artful main

/etc/apt/sources.list

deb http://mirrors.digitalocean.com/ubuntu/ bionic main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic main restricted

deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic-updates main restricted

deb http://mirrors.digitalocean.com/ubuntu/ bionic universe
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic universe
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates universe
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic-updates universe

deb http://mirrors.digitalocean.com/ubuntu/ bionic multiverse

deb http://mirrors.digitalocean.com/ubuntu/ bionic universe
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic universe
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates universe
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic-updates universe

deb http://mirrors.digitalocean.com/ubuntu/ bionic multiverse
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic multiverse
deb http://mirrors.digitalocean.com/ubuntu/ bionic-updates multiverse
deb-src http://mirrors.digitalocean.com/ubuntu/ bionic-updates multiverse

答案1

mssql-server-2017 尚不支持 18.04。您应该等待 Microsoft 支持它,然后相应地更改您的 apt 源文件。准备就绪后,您应该在此处找到说明:

https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017#install

目前这仅涵盖 16.04 的安装,并且 18.04 的相应 APT 存储库尚不存在。

作为等待的替代方案,您可以安装 Ubuntu 16.04 并使用上面链接的 Microsoft 说明来安装 mssql-server。16.04 仍然是受支持且广泛使用的 Ubuntu 版本。

答案2

看起来我们缺少 libicu60 替代依赖项。PR 在这里:https://github.com/dbcli/mssql-cli/pull/205

该修复已被合并并发布。

请重新运行

apt install mssql-cli

它应该解决 libicu60 的附加替代依赖关系。

相关内容