如何在 Artful Aardvark 17.10 上安装 powershell?

如何在 Artful Aardvark 17.10 上安装 powershell?

因为这漏洞无法从 apt 安装 powershell更新Ubuntu版本

$ cat /etc/apt/sources.list.d/microsoft.list
deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main
$ sudo apt install -y 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 resolve the situation:

The following packages have unmet dependencies:
 powershell : Depends: libicu52 but it is not installable
E: Unable to correct problems, you have held broken packages.

事实上,仔细检查后,文档明确指出:

支持 Ubuntu 14.04、Ubuntu 16.04、Ubuntu 17.04

我使用的是 17.10,microsoft.list从系统来看该文件应该是什么样的artful

答案1

您尝试安装适用于 Ubuntu 14.04 的软件包,具有libicu52依赖性,但 Artful(与 Zesty 完全一样)附带了libicu57。至少在依赖项方面,Ubuntu 17.04 的步骤应该适用于 17.10。幸运的是,微软提供了prod.list适用于 17.10 和 18.04 的文件以及:

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

# Register the Microsoft Ubuntu repository – use your exact release only!
curl https://packages.microsoft.com/config/ubuntu/17.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
curl https://packages.microsoft.com/config/ubuntu/17.10/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

# Update the list of products
sudo apt update

# Install PowerShell
sudo apt install powershell

# Start PowerShell
pwsh

相关内容