在 Ubuntu 19.04 中sudo apt install powershell失败
The following packages have unmet dependencies:
powershell : Depends: libssl1.0.0 but it is not installable
Depends: libicu60 but it is not installable
Run Code Online (Sandbox Code Playgroud)
用snap install powershell --classic作品安装它,但它没有出现,/etc/shells所以chsh不起作用。
如何解决这个问题?
跑
sudo snap install powershell --classic
Run Code Online (Sandbox Code Playgroud)Microsoft于 2018 年 8 月 6 日更新了他们的文档,其中描述了 18.04 的步骤。他们的 Powershell 存储库既没有针对 18.10 也没有针对 19.04 更新。
在 19.04 的默认存储库中,libssl 现在是 1.1.1 版本,libcu 现在是 63 版本。因此,为了使用仿生的包,需要使用仿生的依赖项。
使用 dpkg 安装依赖项:
wget http://mirrors.edge.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
sudo dpkg -i libicu60_60.2-3ubuntu3_amd64.deb libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
Run Code Online (Sandbox Code Playgroud)添加微软的仓库信息:
sudo nano /etc/apt/sources.list.d/microsoft-prod.list
Run Code Online (Sandbox Code Playgroud)
添加下面的内容并使用Ctrl+X后跟Y.
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
Run Code Online (Sandbox Code Playgroud)更新和安装 Powershell
sudo apt update
sudo apt install powershell
Run Code Online (Sandbox Code Playgroud)检查 Powershell 的路径是否在/etc/shells 中。如果没有,请添加。对于 Snap 安装,它是/snap/bin/pwsh,对于通过 APT 安装的软件包,它是/usr/bin/pwsh。
运行chsh并输入密码。
| 归档时间: |
|
| 查看次数: |
1733 次 |
| 最近记录: |