Install PowerShell on Ubuntu 22.04 LTS
If you’ve ever wanted to run Windows‑style scripts from your Linux terminal, installing PowerShell on Ubuntu 22.04 is a quick win. In this post I’ll walk you through the exact steps that actually get it working, and point out why each step matters.
Grab Microsoft’s GPG key
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb
Why this matters: Ubuntu refuses to install unsigned packages, so we need Microsoft’s public key in the system’s trusted list before anything else can be added to apt.
Update your package index
sudo apt-get update
Just like any other installation, PowerShell pulls metadata from the repository. Running update guarantees you get the newest version Microsoft has pushed for 22.04.
Install PowerShell
sudo apt-get install -y powershell
The -y flag skips the prompt, but the real kicker is that this pulls a pre‑compiled binary that already bundles all the .NET runtime bits Microsoft expects. No need to manually pull in Mono or dotnet yourself.
Run it for the first time
pwsh
If you see a prompt like PS> that’s proof PowerShell is live. If instead you get “No such file or directory,” double‑check step 3 – the package name is exactly powershell on 22.04.
Optional: Use Snap for a lighter install
sudo snap install powershell --classic
Snap is handy if you don’t want to touch your system’s APT repos, but it comes with a larger runtime footprint and can be slower to start up compared to the direct apt install.
Keep it fresh
When Microsoft releases a new PowerShell version, just run:
sudo apt-get update sudo apt-get install --only-upgrade powershell
No manual downloads or version juggling required.
That’s all there is to it. PowerShell should now be up and running on your Ubuntu 22.04 box.