
在 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
安裝它可以snap install powershell --classic
工作,但它不會出現,/etc/shells
所以chsh
不起作用。
如何解決這個問題?
答案1
使用 Snap 安裝 Powershell
跑步
sudo snap install powershell --classic
使用 APT 安裝 Powershell
微軟更新了他們的文件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
新增微軟的儲存庫資訊:
sudo nano /etc/apt/sources.list.d/microsoft-prod.list
新增以下內容並使用Ctrl+X後跟儲存Y。
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
更新並安裝 Powershell
sudo apt update sudo apt install powershell
要將 Powershell 設定為預設 shell:
檢查Powershell的路徑是否在/etc/shell。如果沒有,請添加。對於 Snap 安裝來說是/snap/bin/pwsh對於透過 APT 安裝的軟體包,它是/usr/bin/pwsh。
運行
chsh
並輸入密碼。- 輸入Powershell的路徑。
- 重新登入或重新啟動。