๐ŸงLinux

Installing PowerShell in Linux is easier than you think

This article is covered in a GeeksForGeeks article, here's the link: https://www.geeksforgeeks.org/how-to-install-powershell-in-linux/

Using Snap

Installing PowerShell Using Snap is as per the following:

Installing PowerShell using snap ( image from GeeksForGeeks )

Using a package repository ( apt )

First update list of system packages using below command:

sudo apt-get update
Update system source ( image from GeeksForGeeks )

Install pre-requisite packages using the below command:

sudo apt-get install -y wget apt-transport-https software-properties-common
Installing pre-requisite packages ( image from GeeksForGeeks )

Now download the Microsoft repository GPG keys and register them:

wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
Registering GPG key ( image from GeeksForGeeks )

Update system source and enable universe repositories:

sudo apt-get update
sudo add-apt-repository universe
Enable universe repositories ( image from GeeksForGeeks )

Finally, install PowerShell using the below command.

sudo apt-get install -y powershell
Installing PowerShell ( image from GeeksForGeeks )

You can test PowerShell functionality using the pwsh command in your terminal.

Starting PowerShell ( image from GeeksForGeeks )

Last updated

Was this helpful?