How to Install PowerShell on Linux Mint 21?

PowerShell is a widely used terminal that comes by default in Microsoft Windows. It can perform all the operations usually carried out using the System’s Graphical User Interface. Because of its wide support and extended functionality, PowerShell is also available for Linux-based machines.  This post will provide a detailed guide to installing PowerShell on Linux Mint 21 (the latest LTS of the Linux Mint)

Approach #1: Install PowerShell on Linux Mint 21 From its Repository 

PowerShell is unavailable in the default repository of Linux Mint. However, we can add its repository and the GPG key to tell the system that it is the secure installation medium. This section will guide you to install PowerShell using the repository of PowerShell.

Step 1: Add the Dependencies

First, add the required dependencies that are required, and your system may be missing. For this, use the command written below. 
$ sudo apt install dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https curl

Step 2: Add the GPG Key of PowerShell’s Repository

After that, add the GPG key of PowerShell’s repository to your system so that it will accept the repository. 
$ curl -fsSL | gpg --dearmor | sudo tee /usr/share/keyrings/powershell.gpg > /dev/null

Step 3: Add PowerShell’s Repository

Now, add the PowerShell repository to your Linux Mint 21 system via the command.
$ echo deb [arch=amd64,armhf,arm64 signed-by=/usr/share/keyrings/powershell.gpg] jammy main | sudo tee /etc/apt/sources.list.d/powershell.list
Note: It can be seen that we are adding the Ubuntu 22.04 support of the repository as the Linux Mint 21 repository has not been released.

Step 4: Update Packages and Install PowerShell

Once the first three steps are performed successfully, now, it is time to update the system’s packages via the command.
$ sudo apt update
After that, use the command written below to install PowerShell on Linux Mint 21 through the apt package manager.
$ sudo apt install powershell

Step 4: Check the Version

.To confirm the installation, use the command to check the version.
$ pwsh --version

Approach #2: Install PowerShell on Linux Mint 21 From Snap (CLI)

Snap is a well-supported and widely used application manager for Linux-based systems. It has strong support to install the packages through the CLI. Do follow the steps to install PowerShell on Linux Mint 21.

Step 1: Enable the Snap Support

We need to remove the “nosnap.pref” file to enable the system to receive packages from the snap. To do so, use the commands below to remove and update the system packages. 
$ sudo rm /etc/apt/preferences.d/nosnap.pref
$ sudo apt update
Now, install the snap daemon by following the command below.
$ sudo apt install snapd

Step 2: Install PowerShell

Once the snap support is enabled, write the command in the terminal to get the PowerShell. Ensure the package name is written correctly (powershell –classic).
$ sudo snap install powershell --classic
The output has verified that PowerShell version 7.3.1 has been installed on the system.

Remove PowerShell From Linux Mint 21

The uninstallation method depends on how you installed the package. For instance, if the package is installed using the snap, it will be removed using snap, and if the apt package manager is used to install it, it will be removed using the apt. Here, we will be discussing both methods. 

Through apt

If you have installed PowerShell from the apt package manager, you can remove it via the command.
$ sudo apt autoremove powershell 

Through Snap

If the package is installed using the snap, it can be removed using the command.
$ sudo snap remove powershell
The output shows that the PowerShell has been removed successfully.


PowerShell is the widely used command line tool that can be installed on Linux Mint 21 to extend the system’s functionality. PowerShell can be installed on Linux Mint 21 from the snap store or by adding PowerShell’s repository. All these methods are briefly explained in this post.
Print Friendly, PDF & Email