Ubuntu is the widely used Debian based Linux distribution. Ubuntu has recently released its Long-Term Support 22.04 with a code name “Jammy Jellyfish”.
This article lists down possible methods to install PowerShell on Ubuntu 22.04 with the following learning outcomes:
How to install PowerShell on Ubuntu 22.04
Ubuntu 22.04 has its own command line terminal with advanced support for Network/System administrators. However, PowerShell can be used as a secondary terminal on Ubuntu 22.04. The following possible methods can be used to install PowerShell on Ubuntu 22.04.
How to install PowerShell on Ubuntu 22.04 from snap
The snap package manager provides a command line and a GUI store to get applications/programs on Ubuntu 22.04.
Step 1: Firstly, install the snap package manager’s service on your system as follows:
We already have the latest version of the snapd.
Step 2: Now, makes use of the below-mentioned command to install PowerShell on Ubuntu:
Once it is installed, you can launch the PowerShell terminal by using the following keywords in Ubuntu’s terminal:
It is observed that the PowerShell’s session is started.
How to install PowerShell from the Ubuntu 22.04 repository
Ubuntu has not yet provided support for PowerShell in its official repository. However, the PowerShell repository can be installed on Ubuntu 22.04.
Step 1: First, download the “.deb” package of PowerShell’s repository for Ubuntu via the following command:
After downloading the “.deb” file, install it by issuing the below-mentioned command:
Step 2: Update the core libraries of Ubuntu 22.04 as follows:
Once the update is performed and the PowerShell repository is acknowledged by your system. Install PowerShell as follows:
The output states that the installation has been completed successfully which states the PowerShell is now installed on Ubuntu 22.04.
How to remove PowerShell from Ubuntu 22.04
PowerShell can be used as a secondary terminal on your Ubuntu 22.04. It can be removed from Ubuntu 22.04 by using one of the following commands.
If PowerShell is installed using the snap package manager, then you can remove/uninstall it by issuing the following command:
If PowerShell is installed by adding its repository, then it can be removed/uninstalled from Ubuntu 22.04 as follows:
Conclusion
PowerShell can be installed on Ubuntu 22.04 from the snap package manager or from the PowerShell’s repository. You have learned both methods to get PowerShell on Ubuntu 22.04. PowerShell is a multipurpose tool for automating several tasks on a computing machine or to develop any tools using its scripting language support. Although PowerShell is an open-source, Ubuntu has not yet added it to its official repository. However, we have provided multiple alternative ways to get PowerShell on Ubuntu 22.04.