How do I install PowerShell?

As of February 2017, Microsoft has made these available though a public repository which brings all the repository goodness. Details here.

Here are the instructions to install the latest version of PowerShell on 16.04.

# 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

For debian install files ('.deb') and other downloads, see PowerShell releases on GitHub.

Direct download links, with SHA256 hashes:

  • 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
    

Download the DEB, verify the checksum, and then let Ubuntu Software Center take care of installing it. See help.ubuntu.com on how to verify the download. Basically, enter the following command:

sha256sum powershell_*.deb

Ubuntu 14.04 and later

PowerShell can be installed as a snap package in all currently supported versions of Ubuntu. To install the PowerShell snap package open the terminal and type:

sudo snap install powershell --classic

To start PowerShell from the terminal type:

snap run powershell