# Linux

{% hint style="info" %}
This article is covered in a **GeeksForGeeks** article, here's the link: <https://www.geeksforgeeks.org/how-to-install-powershell-in-linux/>
{% endhint %}

## Using Snap

Installing **PowerShell** Using **Snap** is as per the following:

<figure><img src="/files/6PSB31pCsLRKmKRH0jRA" alt=""><figcaption><p>Installing PowerShell using snap ( image from GeeksForGeeks )</p></figcaption></figure>

## Using a package repository ( apt )

First update list of system packages using below command:

```bash
sudo apt-get update
```

<figure><img src="/files/q4byhAjGr674ghPdLbUk" alt=""><figcaption><p>Update system source ( image from GeeksForGeeks )</p></figcaption></figure>

Install pre-requisite packages using the below command:

```bash
sudo apt-get install -y wget apt-transport-https software-properties-common
```

<figure><img src="/files/gnPLygcrCdNIu2ZGx2yh" alt=""><figcaption><p>Installing pre-requisite packages  ( image from GeeksForGeeks )</p></figcaption></figure>

Now download the Microsoft repository GPG keys and register them:

```bash
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```

<figure><img src="/files/WqqSa92aiUIH2j727NJo" alt=""><figcaption><p>Registering GPG key ( image from GeeksForGeeks )</p></figcaption></figure>

Update system source and enable universe repositories:

```bash
sudo apt-get update
sudo add-apt-repository universe
```

<figure><img src="/files/H86MvADHFhEctWCOqpDO" alt=""><figcaption><p>Enable universe repositories  ( image from GeeksForGeeks )</p></figcaption></figure>

Finally, install **PowerShell** using the below command.

```bash
sudo apt-get install -y powershell
```

<figure><img src="/files/By2qJE1fgiccyKif7qfC" alt=""><figcaption><p>Installing PowerShell  ( image from GeeksForGeeks )</p></figcaption></figure>

You can test **PowerShell** functionality using the `pwsh` command in your terminal.

<figure><img src="/files/3oo9YALAVENilg5vC1Mk" alt=""><figcaption><p>Starting PowerShell ( image from GeeksForGeeks )</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://powerjs.gitbook.io/powerjs/getting-started/getting-powershell/linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
