Upgrade PowerShell On Ubuntu 20.04

With PowerShell popularity and fast track feature release and bug fixes, your PowerShell version needs to be updated.

This blog post will cover how to upgrade PowerShell 7 on Ubuntu 20.04 server machine and keep your PowerShell version up to date and allow you to take advantage of the latest bug fixes, features, and security bugs.

Check Current Version

Let start with checking the current version of my PowerShell install by running the commands below.


Upgrade Commands

To upgrade PowerShell to the latest version, run the following command or save all of them in a bash .sh script file and run.

sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell

After running, the above command starts PowerShell again using pwsh and check the version. In my case, the version got upgraded from 7.1.5 to 7.2.0, as shown below.

As you can see, the process is straightforward and doesn’t take much.