Site icon TechGit

How to Install PowerShell 7.1.0 via Apt Repository in Ubuntu 20.04, 18.04

Microsoft PowerShell 7.1.0 was released a few days ago with a number of improvements and fixes to PowerShell 7. Here’s how to install it in Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04, and Linux Mint 19.x, 20.

PowerShell 7.1.0 release highlights:

How to Install PowerShell in Ubuntu:

If you’re OK with containerized Snap package, simply search for and install powershell from Ubuntu Software.

For those prefer .deb package, Microsoft offers the software in its official apt repository.

1. Setup Microsoft apt repository in Ubuntu:

Open terminal from your system application launcher. When it opens, run command to download the official .deb package:

wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

For Linux Mint, replace $(lsb_release -rs) in the code with 20.04 for Linux Mint 20 (or 18.04 for Mint 19.x).

Then install the package, which will install Microsoft repository and key, by running command:

sudo dpkg -i packages-microsoft-prod.deb

Type user password (no asterisk feedback) for sudo prompts and hit Enter.

2. Install PowerShell:

After adding the repository, run following 2 commands one by one to check package updates and install the software:

sudo apt update

sudo apt install powershell

Once installed, run pwsh to start PowerShell.

Uninstall PowerShell:

To remove the software, simply open terminal and run command:

sudo apt remove powershell

To remove the apt repository, simply go to Software & Updates > Other Software tab, and remove the relevant line.

Original Article

FacebookTwitterTumblrRedditLinkedInHacker NewsDiggBufferGoogle ClassroomThreadsXINGShare
Exit mobile version