> 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

Installing PowerShell in Linux is easier than you think

{% 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2FuECkfp4g4lVFt05VvuCY%2Fimage.png?alt=media&amp;token=7fe2b27f-64f3-4c2c-b323-fad4bb1dbe4a" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2FgSuIcCCBy5WKTnAqFMs7%2Fimage.png?alt=media&amp;token=e6014a9f-0fe9-4701-a2c7-c6aa17930d69" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2F0cOVsN1fcqFT0JpkzhLD%2Fimage.png?alt=media&amp;token=dead0b81-2cf2-4c13-bf23-5b6dfc2f6a1e" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2FS6NDMo0i90GOXLstD5Ya%2Fimage.png?alt=media&amp;token=8cb4ce50-ff98-4a17-b01c-d4d39a5c714b" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2FcxeM50fuP5IYYUc3wmmj%2Fimage.png?alt=media&amp;token=5e448fcd-3ff3-4c86-9c3c-a854aa1552d2" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2FgwRLKq2GqRZRp178ZF7h%2Fimage.png?alt=media&amp;token=7e65d3b9-d08c-45b1-8fa7-6b111de7cbae" 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="https://2193159300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SiNigX5IIotGXFYF2oe%2Fuploads%2F35K9X2XoCMNygCHBI9Gc%2Fimage.png?alt=media&amp;token=6f930a7d-ebc2-4c66-bfab-90e66257b50b" alt=""><figcaption><p>Starting PowerShell ( image from GeeksForGeeks )</p></figcaption></figure>
