> For the complete documentation index, see [llms.txt](https://powerjs.gitbook.io/powerjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://powerjs.gitbook.io/powerjs/getting-started/getting-powershell/linux.md).

# 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>
