Answers:
截至2017年2月,Microsoft通过公共存储库提供了这些存储库,从而带来了所有存储库的优势。详细信息在这里。
以下是在16.04上安装最新版本的PowerShell的说明。
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update the list of products
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell (MS renamed main executable at launch to be more Linux-like)
pwsh
有关debian安装文件('.deb')和其他下载的信息,请参阅GitHub上的PowerShell版本。
具有SHA256散列的直接下载链接:
14.04:powershell_6.0.0-alpha.16-1ubuntu1.14.04.1_amd64.deb
FB0002D6D57D900D0BA16C13C4EB0B84CA9D1AEA5EAF4DDBC0F7E8F3D582A2DF
16.04:powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
96A647EFA64C704958CEAFA89F319950A3B729C161CB77C286561AF3CD3BFC1E
下载DEB,验证校验和,然后让Ubuntu Software Center负责安装。有关如何验证下载的信息,请访问help.ubuntu.com。基本上,输入以下命令:
sha256sum powershell_*.deb
PowerShell可以作为快照包安装在当前所有受支持的Ubuntu版本中。要安装PowerShell snap软件包,请打开终端并输入:
sudo snap install powershell --classic
PowerShell
发布: v6.0.0-beta.4
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.4/powershell_6.0.0-beta.4-1ubuntu1.14.04.1_amd64.deb
sudo apt install ./powershell_*.deb
[方法2]〜dpkg
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.4/powershell_6.0.0-beta.4-1ubuntu1.14.04.1_amd64.deb
dpkg -i powershell_*.deb
apt-get install -f
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.4/powershell_6.0.0-beta.4-1ubuntu1.16.04.1_amd64.deb
sudo apt install ./powershell_*.deb
[方法2]〜dpkg
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.4/powershell_6.0.0-beta.4-1ubuntu1.16.04.1_amd64.deb
dpkg -i powershell_*.deb
apt-get install -f
apt install ./foo.deb
将解决依赖关系,因此您不需要apt-get install -f
之后。