11---
22description : How to install PowerShell on Debian Linux
3- ms.date : 02/20 /2026
4- title : Install PowerShell on Debian
3+ ms.date : 03/06 /2026
4+ title : Install PowerShell 7 on Debian
55---
6- # Install PowerShell on Debian
6+ # Install PowerShell 7 on Debian
77
8- All packages are available on our GitHub [ releases ] [ 02 ] page. Before installing, check the list of
9- [ Supported versions ] [ 01 ] below. After the package is installed, run ` pwsh ` from a terminal. Run
10- ` pwsh-lts ` if you installed a preview release .
8+ There are multiple package versions of PowerShell 7 that can be installed. This article focuses on
9+ installing the latest stable release package. For more information about the package versions, see
10+ the [ PowerShell Support Lifecycle ] [ 05 ] article .
1111
1212Newer versions of PowerShell 7 replace existing previous versions of PowerShell 7. Preview versions
1313of PowerShell can be installed side-by-side with other versions of PowerShell. Newer preview
1414versions replace existing previous preview versions. If you need to run PowerShell 7.5 side-by-side
15- with a previous version, reinstall the previous version using the [ binary archive] [ 05 ] method.
15+ with a previous version, reinstall the previous version using the [ binary archive] [ 04 ] method.
1616
17- Debian uses APT (Advanced Package Tool) as a package manager.
17+ ## Choose an installation method
1818
19- [ !INCLUDE [ Latest version] ( ../../includes/latest-install.md )]
19+ On Debian Linux, you can install PowerShell using the universal ` .deb ` package from the Microsoft
20+ package repository or by downloading a file from the GitHub [ releases] [ 01 ] page.
2021
21- ## Installation on Debian 11 or 12 via the Package Repository
22+ ### Install PowerShell 7 from the Package Repository
2223
2324Microsoft builds and supports a variety of software products for Linux systems and makes them
2425available via Linux packaging clients (apt, dnf, yum, etc). These Linux software packages are hosted
25- on the _ Linux package repository for Microsoft products_ , [ https://packages.microsoft.com ] [ 03 ] , also
26+ on the _ Linux package repository for Microsoft products_ , [ https://packages.microsoft.com ] [ 02 ] , also
2627known as _ PMC_ .
2728
2829Installing PowerShell from PMC is the preferred method of installation.
2930
3031> [ !NOTE]
31- > This script only works for supported versions of Debian.
32+ > This script only works for supported versions of Debian that have a package published to the
33+ > Microsoft package repository.
3234
3335``` sh
3436#! /bin/bash
@@ -64,17 +66,15 @@ sudo apt-get install -y powershell
6466pwsh
6567```
6668
67- ## Installation via direct download
69+ ### Manually download and install PowerShell 7
6870
69- PowerShell 7.2 introduced a universal package that makes installation easier. Download the universal
70- package from the [ releases ] [ 02 ] page onto your Debian machine .
71+ Download the universal package from the GitHub releases page. Choose the link for the version you
72+ want to install .
7173
72- The link to the current version is:
73-
74- - PowerShell 7.4 (LTS) universal package for supported versions of Debian
75- - ` https://github.com/PowerShell/PowerShell/releases/download/v7.4.13/powershell_7.4.13-1.deb_amd64.deb `
7674- PowerShell 7.5 universal package for supported versions of Debian
7775 - ` https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/powershell_7.5.4-1.deb_amd64.deb `
76+ - PowerShell 7.4 (LTS) universal package for supported versions of Debian
77+ - ` https://github.com/PowerShell/PowerShell/releases/download/v7.4.13/powershell_7.4.13-1.deb_amd64.deb `
7878- PowerShell 7.6-preview universal package for supported versions of Debian
7979 - ` https://github.com/PowerShell/PowerShell/releases/download/v7.6.0-rc1/powershell-preview_7.6.0-rc1-1.deb_amd64.deb `
8080
@@ -109,15 +109,14 @@ rm powershell_7.5.4-1.deb_amd64.deb
109109pwsh
110110```
111111
112- ## Uninstall PowerShell
112+ ## Start PowerShell 7
113113
114- ``` sh
115- sudo apt-get remove powershell
116- ```
114+ After the package is installed, run ` pwsh ` from a terminal. If you have installed a Preview package,
115+ run ` pwsh-preview ` .
117116
118- ## PowerShell paths
119-
120- - ` $PSHOME ` is ` /opt/microsoft/powershell/7/ `
117+ - The location of ` $PSHOME ` varies based on the package you installed.
118+ - For Stable and LTS packages: ` /opt/microsoft/powershell/7/ `
119+ - For Preview packages: ` /opt/microsoft/powershell/7-preview / `
121120- The profiles scripts are stored in the following locations:
122121 - AllUsersAllHosts - ` $PSHOME/profile.ps1 `
123122 - AllUsersCurrentHost - ` $PSHOME/Microsoft.PowerShell_profile.ps1 `
@@ -129,21 +128,30 @@ sudo apt-get remove powershell
129128 - Default modules - ` $PSHOME/Modules `
130129- PSReadLine history is recorded in ` ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt `
131130
132- PowerShell respects the [ XDG Base Directory Specification] [ 04 ] on Linux.
131+ The profiles respect PowerShell's per-host configuration, so the default host-specific profiles
132+ exists at ` Microsoft.PowerShell_profile.ps1 ` in the same locations.
133+
134+ PowerShell respects the [ XDG Base Directory Specification] [ 03 ] on Linux.
135+
136+ ## Uninstall PowerShell 7
137+
138+ ``` sh
139+ sudo apt-get remove powershell
140+ ```
133141
134- ## Supported versions
142+ ## Supported OS versions
135143
136144[ !INCLUDE [ Debian support] ( ../../includes/debian-support.md )]
137145
138- ## Installation support
146+ ## Supported installation methods
139147
140148Microsoft supports the installation methods in this document. There may be other methods of
141149installation available from other third-party sources. While those tools and methods may work,
142150Microsoft can't support those methods.
143151
144152<!-- link references -->
145- [ 01 ] : #supported-versions
146- [ 02 ] : https://aka.ms/PowerShell-Release?tag=stable
147- [ 03 ] : https://packages.microsoft.com
148- [ 04 ] : https://specifications.freedesktop.org/basedir/latest/
149- [ 05 ] : install-other-linux .md#binary-archives
153+ [ 01 ] : https://github.com/PowerShell/PowerShell/releases
154+ [ 02 ] : https://packages.microsoft.com
155+ [ 03 ] : https://specifications.freedesktop.org/basedir/latest/
156+ [ 04 ] : install-other-linux.md#binary-archives
157+ [ 05 ] : PowerShell-Support-Lifecycle .md
0 commit comments