$put_perv_real = "/home/www/dvakompa-ru/dopol/"; ?>
Supports Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Ubuntu 18.10, Debian 9, CentOS 7, Red Hat Enterprise Linux (RHEL) 7, openSUSE 42.3, openSUSE Leap 15, Fedora 27, Fedora 28, and Arch Linux.
For Linux distributions that are not officially supported, you can try using the PowerShell Snap Package. You can also try deploying PowerShell binaries directly using the Linux tar.gz
archive, but you would need to set up the necessary dependencies based on the OS in separate steps.
All packages are available on our GitHub releases page. Once the package is installed, run pwsh
from a terminal.
When installing a PowerShell Core Preview release for Linux via a Package Repository, the package name changes from powershell
to powershell-preview
.
Installing via direct download does not change, other than the file name.
Here is a table of the commands to install the stable and preview packages using the various package managers:
Distribution(s) | Stable Command | Preview Command |
---|---|---|
Ubuntu, Debian | sudo apt-get install -y powershell |
sudo apt-get install -y powershell-preview |
CentOS, RedHat | sudo yum install -y powershell |
sudo yum install -y powershell-preview |
Fedora | sudo dnf install -y powershell |
sudo dnf install -y powershell-preview |
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates). This is the preferred method.
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb# Update the list of products
sudo apt-get update# Install PowerShell
sudo apt-get install -y powershell# Start PowerShell
pwsh
As superuser, register the Microsoft repository. From then on, you just need to use sudo apt-get upgrade powershell
to update the installation.
Download the Debian package powershell_6.2.0-1.ubuntu.14.04_amd64.deb
from the releases page onto the Ubuntu machine.
Then execute the following in the terminal:
sudo dpkg -i powershell_6.2.0-1.ubuntu.14.04_amd64.deb
sudo apt-get install -f
Note
The dpkg -i
command fails with unmet dependencies. The next command, apt-get install -f
resolves these issues then finishes configuring the PowerShell package.
sudo apt-get remove powershell
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates). This is the preferred method.
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb# Update the list of products
sudo apt-get update# Install PowerShell
sudo apt-get install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, from then on, you just need to use sudo apt-get upgrade powershell
to update it.
Download the Debian package powershell_6.2.0-1.ubuntu.16.04_amd64.deb
from the releases page onto the Ubuntu machine.
Then execute the following in the terminal:
sudo dpkg -i powershell_6.2.0-1.ubuntu.16.04_amd64.deb
sudo apt-get install -f
Note
The dpkg -i
command fails with unmet dependencies. The next command, apt-get install -f
resolves these issues then finishes configuring the PowerShell package.
sudo apt-get remove powershell
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates). This is the preferred method.
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb# Update the list of products
sudo apt-get update# Enable the "universe" repositories
sudo add-apt-repository universe# Install PowerShell
sudo apt-get install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, from then on, you just need to use sudo apt-get upgrade powershell
to update it.
Download the Debian package powershell_6.2.0-1.ubuntu.18.04_amd64.deb
from the releases page onto the Ubuntu machine.
Then execute the following in the terminal:
sudo dpkg -i powershell_6.2.0-1.ubuntu.18.04_amd64.deb
sudo apt-get install -f
Note
The dpkg -i
command fails with unmet dependencies. The next command, apt-get install -f
resolves these issues then finishes configuring the PowerShell package.
sudo apt-get remove powershell
Note
As 18.10 is an interim release, it is only community supported.
Installing on 18.10 is supported via snapd
. See Snap Package for full instructions;
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates). This is the preferred method.
# Install system components
sudo apt-get update
sudo apt-get install curl apt-transport-https# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -# Register the Microsoft Product feed
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/microsoft.list'# Update the list of products
sudo apt-get update# Install PowerShell
sudo apt-get install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, from then on, you just need to use sudo apt-get upgrade powershell
to update it.
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates). This is the preferred method.
# Install system components
sudo apt-get update
sudo apt-get install curl gnupg apt-transport-https# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -# Register the Microsoft Product feed
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list'# Update the list of products
sudo apt-get update# Install PowerShell
sudo apt-get install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, from then on, you just need to use sudo apt-get upgrade powershell
to update it.
Download the Debian package powershell_6.2.0-1.debian.9_amd64.deb
from the releases page onto the Debian machine.
Then execute the following in the terminal:
sudo dpkg -i powershell_6.2.0-1.debian.9_amd64.deb
sudo apt-get install -f
sudo apt-get remove powershell
Note
This package also works on Oracle Linux 7.
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo# Install PowerShell
sudo yum install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, you just need to use sudo yum update powershell
to update PowerShell.
Using CentOS 7, download the RPM package powershell-6.2.0-1.rhel.7.x86_64.rpm
from the releases page onto the CentOS machine.
Then execute the following in the terminal:
sudo yum install powershell-6.2.0-1.rhel.7.x86_64.rpm
You can also install the RPM without the intermediate step of downloading it:
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
sudo yum remove powershell
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo# Install PowerShell
sudo yum install -y powershell# Start PowerShell
pwsh
After registering the Microsoft repository once as superuser, you just need to use sudo yum update powershell
to update PowerShell.
Download the RPM package powershell-6.2.0-1.rhel.7.x86_64.rpm
from the releases page onto the Red Hat Enterprise Linux machine.
Then execute the following in the terminal:
sudo yum install powershell-6.2.0-1.rhel.7.x86_64.rpm
You can also install the RPM without the intermediate step of downloading it:
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
sudo yum remove powershell
# Install dependencies
zypper update && zypper --non-interactive install curl tar libicu52_1# Download the powershell '.tar.gz' archive
curl -L https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz# Create the target folder where powershell will be placed
mkdir -p /opt/microsoft/powershell/6.2.0# Expand powershell to the target folder
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0# Set execute permissions
chmod +x /opt/microsoft/powershell/6.2.0/pwsh# Create the symbolic link that points to pwsh
ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh# Start PowerShell
pwsh
# Install dependencies
zypper update && zypper --non-interactive install curl tar gzip libopenssl1_0_0 libicu60_2# Download the powershell '.tar.gz' archive
curl -L https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz# Create the target folder where powershell will be placed
mkdir -p /opt/microsoft/powershell/6.2.0# Expand powershell to the target folder
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0# Set execute permissions
chmod +x /opt/microsoft/powershell/6.2.0/pwsh# Create the symbolic link that points to pwsh
ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh# Start PowerShell
pwsh
rm -rf /usr/bin/pwsh /opt/microsoft/powershell
Note
Fedora 28 is only supported in PowerShell Core 6.1 and newer.
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo# Update the list of products
sudo dnf update# Install a system component
sudo dnf install compat-openssl10# Install PowerShell
sudo dnf install -y powershell# Start PowerShell
pwsh
Download the RPM package powershell-6.2.0-1.rhel.7.x86_64.rpm
from the releases page onto the Fedora machine.
Then execute the following in the terminal:
sudo dnf install compat-openssl10
sudo dnf install powershell-6.2.0-1.rhel.7.x86_64.rpm
You can also install the RPM without the intermediate step of downloading it:
sudo dnf install compat-openssl10
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
sudo dnf remove powershell
Note
Arch support is experimental.
PowerShell is available from the Arch Linux User Repository (AUR).
Packages in the AUR are community maintained - there is no official support.
For more information on installing packages from the AUR, see the Arch Linux wiki or the community DockerFile.
snapd
is required to run snaps. Use these instructions to make sure you have snapd
installed.
PowerShell Core, for Linux, is published to the Snap store for easy installation (and updates). This is the preferred method.
# Install PowerShell
sudo snap install powershell --classic# Start PowerShell
pwsh
If you want to install preview version, use following method.
# Install PowerShell
sudo snap install powershell-preview --classic# Start PowerShell
pwsh-preview
After installing Snap will automatically upgrade, but you can trigger an upgrade using sudo snap refresh powershell
or sudo snap refresh powershell-preview
.
sudo snap remove powershell
or
sudo snap remove powershell-preview
# Download & Install prerequisites
wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u2_amd64.deb
dpkg -i libicu57_57.1-6+deb9u2_amd64.deb
apt-get update && apt-get install -y curl gnupg apt-transport-https# Add Microsoft public repository key to APT
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -# Add Microsoft package repository to the source list
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" | tee /etc/apt/sources.list.d/powershell.list# Install PowerShell package
apt-get update && apt-get install -y powershell# Start PowerShell
pwsh
# Uninstall PowerShell package
apt-get remove -y powershell
Note
Raspbian support is experimental.
Currently, PowerShell is only supported on Raspbian Stretch.
Also CoreCLR (and thus PowerShell Core) will only work on Pi 2 and Pi 3 devices as other devices, like Pi Zero, have an unsupported processor.
Download Raspbian Stretch and follow the installation instructions to get it onto your Pi.
# Install prerequisites
sudo apt-get install libunwind8# Grab the latest tar.gz
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-arm32.tar.gz# Make folder to put powershell
mkdir ~/powershell# Unpack the tar.gz file
tar -xvf ./powershell-6.2.0-linux-arm32.tar.gz -C ~/powershell# Start PowerShell
~/powershell/pwsh
Optionally you can create a symbolic link to be able to start PowerShell without specifying path to the "pwsh" binary
# Start PowerShell from bash with sudo to create a symbolic link
sudo ~/powershell/pwsh -c New-Item -ItemType SymbolicLink -Path "/usr/bin/pwsh" -Target "\$PSHOME/pwsh" -Force# alternatively you can run following to create a symbolic link
# sudo ln -s ~/powershell/pwsh /usr/bin/pwsh# Now to start PowerShell you can just run "pwsh"
rm -rf ~/powershell
PowerShell binary tar.gz
archives are provided for Linux platforms to enable advanced deployment scenarios.
PowerShell builds portable binaries for all Linux distributions. But .NET Core runtime requires different dependencies on different distributions, and hence PowerShell does the same.
The following chart shows the .NET Core 2.0 dependencies that are officially supported on different Linux distributions.
OS | Dependencies |
---|---|
Ubuntu 14.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu52 |
Ubuntu 16.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu55 |
Ubuntu 17.10 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu57 |
Ubuntu 18.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu60 |
Debian 8 (Jessie) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu52 |
Debian 9 (Stretch) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.2, libicu57 |
CentOS 7 Oracle Linux 7 RHEL 7 |
libunwind, libcurl, openssl-libs, libicu |
openSUSE 42.3 | libcurl4, libopenssl1_0_0, libicu52_1 |
openSUSE Leap 15 | libcurl4, libopenssl1_0_0, libicu60_2 |
Fedora 27 Fedora 28 |
libunwind, libcurl, openssl-libs, libicu, compat-openssl10 |
To deploy PowerShell binaries on Linux distributions that are not officially supported, you need to install the necessary dependencies for the target OS in separate steps. For example, our Amazon Linux dockerfile installs dependencies first, and then extracts the Linux tar.gz
archive.
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-x64.tar.gz# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/6.2.0# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/6.2.0/pwsh# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh
sudo rm -rf /usr/bin/pwsh /opt/microsoft/powershell
$PSHOME
is /opt/microsoft/powershell/6.2.0/
~/.config/powershell/profile.ps1
$PSHOME/profile.ps1
~/.local/share/powershell/Modules
/usr/local/share/powershell/Modules
$PSHOME/Modules
~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
The profiles respect PowerShell's per-host configuration, so the default host-specific profiles exists at Microsoft.PowerShell_profile.ps1
in the same locations.
PowerShell respects the XDG Base Directory Specification on Linux.