How do I install PowerShell?

Not long ago I read something on Microsoft's website about PowerShell being available for Ubuntu.

How would I go about the install of PowerShell? I'd appreciate guidance for both Xenial & Trusty.

Any installation method is fine, whether compiling source or relying on a package-manager. Source-compiling methods should contain beginner-level detail.


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

PowerShell Release: v6.0.0-beta.4


Ubuntu 14.04 LTS (Trusty Tahr)

[Method #1] ~ APT
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
[Method #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

Ubuntu 16.04 LTS (Xenial Xerus)

[Method #1] ~ APT
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
[Method #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

  • PowerShell - Releases (GitHub)
  • PowerShell - Documentation
  • PowerShell - Beginner's Guide
  • PowerShell - Command-line Debugging