All packages are available on our GitHub releases page. Before installing,
check the list of Supported versions below. After the package is installed, run
pwsh from a terminal. Run pwsh-lts if you installed a preview release.
Note
PowerShell 7.4 is an in-place upgrade that removes previous versions of PowerShell 7. Preview
versions of PowerShell can be installed side-by-side with other versions of PowerShell. If you
need to run PowerShell 7.4 side-by-side with a previous version, reinstall the previous version
using the binary archive method.
Ubuntu uses APT (Advanced Package Tool) as a package manager.
Note
The installation commands in this article are for the latest stable release of PowerShell. To
install a different version of PowerShell, adjust the command to match the version you need. The
following links direct you to the release page for each version in the PowerShell repository on
GitHub.
Download links for every package are found in the Assets section of the Release page. The
Assets section may be collapsed, so you may need to click to expand it.
Installation via Package Repository the Package Repository
Microsoft builds and supports a variety of software products for Linux systems and makes them
available via Linux packaging clients (apt, dnf, yum, etc). These Linux software packages are hosted
on the Linux package repository for Microsoft products, https://packages.microsoft.com, also
known as PMC.
Installing PowerShell from PMC is the preferred method of installation.
Note
This script only works for supported versions of Ubuntu.
sh
#################################### Prerequisites# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Get the version of Ubuntusource /etc/os-release
# Download the Microsoft repository keys
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
# Register the Microsoft repository keys
sudo dpkg -i packages-microsoft-prod.deb
# Delete the Microsoft repository keys file
rm packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
#################################### Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
Important
Ubuntu comes preconfigured with a package repository that includes .NET packages, but not
PowerShell. Using these instructions to install PowerShell registers the Microsoft repository as a
package source. You can install PowerShell and some versions of .NET from this repository.
However, the Ubuntu package repository has different versions of the .NET packages. This can cause
problems when installing .NET for other purposes. For more information about these problems, see
Troubleshoot .NET package mix ups on Linux.
PowerShell 7.2 introduced a universal package that makes installation easier. Download the universal
package from the releases page onto your Ubuntu machine.
The link to the current version is:
PowerShell 7.4 (LTS) universal package for supported versions of Ubuntu
The following shell script downloads and installs the current preview release of PowerShell. You can
change the URL to download the version of PowerShell that you want to install.
sh
#################################### Prerequisites# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget
# Download the PowerShell package file
wget https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/powershell_7.5.0-1.deb_amd64.deb
#################################### Install the PowerShell package
sudo dpkg -i powershell_7.5.0-1.deb_amd64.deb
# Resolve missing dependencies and finish the install (if necessary)
sudo apt-get install -f
# Delete the downloaded package file
rm powershell_7.5.0-1.deb_amd64.deb
# Start PowerShell Preview
pwsh
Uninstall PowerShell
sh
sudo apt-get remove powershell
Support for Arm processors
PowerShell 7.2 and newer supports running on Ubuntu using 32-bit Arm processors. Use the binary
archive installation method of installing PowerShell that's described in
Alternate ways to install PowerShell on Linux.
PowerShell paths
$PSHOME is /opt/microsoft/powershell/7/
The profiles scripts are stored in the following locations:
Docker images containing PowerShell 7.4 and PowerShell 7.5-preview for x64 and Arm32 are available
from the Microsoft Artifact Registry for the following versions of Ubuntu:
Ubuntu 24.04 (Noble Numbat) - OS support ends on 2029-04-01
Ubuntu 22.04 (Jammy Jellyfish) - OS support ends on 2027-04-01
Ubuntu 20.04 (Focal Fossa) - OS support ends on 2025-04-02
The Docker images are built from official operating system (OS) images provide by the OS
distributor. These images may not have the latest security updates. Microsoft recommends that you
update the OS packages to the latest version to ensure the latest security updates are applied.
Installation support
Microsoft supports the installation methods in this document. There may be other methods of
installation available from other third-party sources. While those tools and methods may work,
Microsoft can't support those methods.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
PowerShell feedback
PowerShell is an open source project. Select a link to provide feedback:
Streamline the installation and maintenance of software on your computer by using Windows Package Manager. Explain the front-end components and commands, the Windows Package Manager repository, and how to contribute to the repository.