簡體   English   中英

如何在 ubuntu 20.04 上安裝 powershell?

[英]How to install powershell on ubuntu 20.04?

我嘗試使用Azure 手冊在 ubuntu 20.04 docker 圖像上安裝 power-shell,但我得到了

Step 10/30 : RUN wget -q "https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb"
wget: error getting response: Invalid argument

我在這里做錯了什么?

我的容器操作系統是:

root@:/opt# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

• 您用於在 Ubuntu 20.04 docker 映像上安裝“Powershell”的命令不正確 The correct command to install 'Powershell' from the Ubuntu repository is as follows :-

  wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

Once you execute the above command, the required installable files for 'Powershell' are downloaded and further then to install the files, execute the command below :-

 dpkg -i packages-microsoft-prod.deb

• 接下來,使用 Microsoft 更新 CDN 中與“Powershell”命令或功能更新相關的最新更改或更新來更新存儲庫,並借助以下命令安裝“Powershell” :-

 apt-get update -y
 apt-get install powershell -y

完成上述操作后,您可以通過執行以下命令成功連接到 Powershell :-

pwsh

有關更多詳細信息,請參閱以下鏈接:-

https://www.howtoforge.com/how-to-install-and-use-powershell-on-ubuntu-20-04/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM