This guide walks through installing PowerShell on Ubuntu 24.04 using the Microsoft repository, importing the signing key, and verifying a successful installation.
PowerShell is fully cross-platform thanks to its .NET Core foundation. Installing it on Ubuntu allows Linux users to leverage automation, scripting, and rich command-line tooling directly within the terminal.
The steps below walk through updating your system, installing prerequisites, importing Microsoft's signing key, enabling the repository, and installing PowerShell.
Updating ensures Ubuntu retrieves the latest metadata for available packages and prevents conflicts when adding new repositories.





Microsoft signs all official Linux packages. Importing the GPG key ensures Ubuntu only installs authentic, verified PowerShell builds.

This adds the official Microsoft apt repository, enabling PowerShell installation through standard package management.

After adding the new repository, apt must refresh its index to detect available Microsoft packages.

PowerShell can now be installed using apt, which downloads the latest stable Linux build from Microsoft.

Running pwsh --version confirms a successful installation. PowerShell can now be launched by typing pwsh.
