2017-03-21 23:20:11 +01:00
# Package installation instructions
2016-03-31 08:29:16 +02:00
2016-08-12 01:50:50 +02:00
Supports [Ubuntu 14.04][u14], [Ubuntu 16.04][u16],
2017-03-02 02:38:24 +01:00
[CentOS 7][cos], [Arch Linux][arch], [many Linux distributions (AppImage)][lai], and [macOS 10.11][mac].
2016-07-27 21:55:10 +02:00
All packages are available on our GitHub [releases][] page.
2016-03-31 08:29:16 +02:00
2017-01-03 23:32:54 +01:00
All of these steps can be done automatically by the [`download.sh`][download] script.
2016-09-20 23:10:40 +02:00
You should *never* run a script without reading it first!
Please **read the [download][] script first** , and then if you want to run it, use:
```sh
2017-04-07 06:27:48 +02:00
bash < (curl -fsSL https://raw.githubusercontent.com/PowerShell/PowerShell/v6.0.0-alpha.18/tools/download.sh)
2016-09-20 23:10:40 +02:00
```
2016-08-01 22:46:48 +02:00
Once the package is installed, run `powershell` from a terminal.
2016-03-31 08:29:16 +02:00
2016-08-12 01:50:50 +02:00
[u14]: #ubuntu -1404
[u16]: #ubuntu -1604
[cos]: #centos -7
2017-03-02 02:38:24 +01:00
[arch]: #arch -linux
2016-08-23 02:37:43 +02:00
[lai]: #linux -appimage
[mac]: #macos -1011
2017-04-07 06:27:48 +02:00
[download]: https://github.com/PowerShell/PowerShell/blob/v6.0.0-alpha.18/tools/download.sh
2016-08-01 22:46:48 +02:00
2017-03-21 23:20:11 +01:00
## Ubuntu 14.04
2016-03-31 08:29:16 +02:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository - Ubuntu 14.04
2017-03-18 03:34:25 +01:00
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update apt-get
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
powershell
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
### Installation via Direct Download
2016-08-12 01:50:50 +02:00
Using [Ubuntu 14.04][], download the Debian package
2017-04-07 06:27:48 +02:00
`powershell_6.0.0-alpha.18-1ubuntu1.14.04.1_amd64.deb`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the Ubuntu machine.
2016-07-27 21:55:10 +02:00
Then execute the following in the terminal:
2016-03-31 08:29:16 +02:00
```sh
2017-04-07 06:27:48 +02:00
sudo dpkg -i powershell_6.0.0-alpha.18-1ubuntu1.14.04.1_amd64.deb
2016-09-20 01:34:23 +02:00
sudo apt-get install -f
2016-03-31 08:29:16 +02:00
```
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
2016-09-13 06:12:00 +02:00
2017-03-21 23:20:11 +01:00
### Uninstallation - Ubuntu 14.04
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo apt-get remove powershell
```
2016-03-31 08:29:16 +02:00
2016-07-27 21:55:10 +02:00
[Ubuntu 14.04]: http://releases.ubuntu.com/14.04/
2016-03-31 08:29:16 +02:00
2017-03-21 23:20:11 +01:00
## Ubuntu 16.04
2016-08-12 01:50:50 +02:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository - Ubuntu 16.04
2017-03-18 03:34:25 +01:00
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update apt-get
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
powershell
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
2017-03-28 01:44:28 +02:00
### Installation via Direct Download - Ubuntu 16.04
2017-03-18 03:34:25 +01:00
2016-08-12 01:50:50 +02:00
Using [Ubuntu 16.04][], download the Debian package
2017-04-07 06:27:48 +02:00
`powershell_6.0.0-alpha.18-1ubuntu1.16.04.1_amd64.deb`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the Ubuntu machine.
Then execute the following in the terminal:
```sh
2017-04-07 06:27:48 +02:00
sudo dpkg -i powershell_6.0.0-alpha.18-1ubuntu1.16.04.1_amd64.deb
2016-09-20 01:34:23 +02:00
sudo apt-get install -f
2016-08-12 01:50:50 +02:00
```
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
2016-09-13 06:12:00 +02:00
2017-03-21 23:20:11 +01:00
### Uninstallation - Ubuntu 16.04
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo apt-get remove powershell
```
2016-08-12 01:50:50 +02:00
[Ubuntu 16.04]: http://releases.ubuntu.com/16.04/
2016-08-30 04:28:26 +02:00
This works for Debian Stretch (now testing) as well.
2016-08-12 01:50:50 +02:00
2017-03-21 23:20:11 +01:00
## CentOS 7
2016-07-27 21:55:10 +02:00
2017-03-25 00:46:05 +01:00
> This package also works on Oracle Linux 7 and Red Hat Enterprise Linux (RHEL) 7.
2017-03-18 03:34:25 +01:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository (preferred) - CentOS 7
2017-03-25 00:46:05 +01:00
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
2017-03-18 03:34:25 +01:00
```sh
# 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
powershell
```
After registering the Microsoft repository once as superuser,
2017-03-25 00:46:05 +01:00
you just need to use `sudo yum update powershell` to update PowerShell.
2017-03-18 03:34:25 +01:00
2017-03-28 01:44:28 +02:00
### Installation via Direct Download - CentOS 7
2017-03-18 03:34:25 +01:00
2016-08-12 01:50:50 +02:00
Using [CentOS 7][], download the RPM package
2017-04-07 06:27:48 +02:00
`powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the CentOS machine.
2016-07-27 21:55:10 +02:00
Then execute the following in the terminal:
2016-03-31 08:29:16 +02:00
```sh
2017-04-07 06:27:48 +02:00
sudo yum install ./powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm
2016-03-31 08:29:16 +02:00
```
2016-08-23 22:13:39 +02:00
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-04-07 06:27:48 +02:00
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.18/powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm
2016-08-23 22:13:39 +02:00
```
2017-03-21 23:20:11 +01:00
### Uninstallation
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo yum remove powershell
```
2016-09-13 06:12:00 +02:00
2016-07-27 21:55:10 +02:00
[CentOS 7]: https://www.centos.org/download/
2017-04-05 02:41:40 +02:00
## OpenSUSE 42.1
Installation instruction for OpenSUSE 42.1.
### Installation via Direct Download - OpenSUSE 42.1
Using [OpenSUSE 42.1][], download the RPM package
2017-04-07 06:27:48 +02:00
`powershell-6.0.0_alpha.18-1.suse.42.1.x86_64.rpm`
2017-04-05 02:41:40 +02:00
from the [releases][] page onto the OpenSUSE machine.
Then execute the following in the terminal:
```sh
2017-04-07 06:27:48 +02:00
rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo zypper install ./powershell-6.0.0_alpha.18-1.suse.42.1.x86_64.rpm
2017-04-05 02:41:40 +02:00
```
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-04-07 06:27:48 +02:00
rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo zypper install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.18/powershell-6.0.0_alpha.18-1.suse.42.1.x86_64.rpm
2017-04-05 02:41:40 +02:00
```
### Uninstallation - OpenSUSE 42.1
```sh
sudo zypper remove powershell
```
[OpenSUSE 42.1]: https://software.opensuse.org/421/en
2017-03-21 23:20:11 +01:00
## Arch Linux
2017-03-02 02:38:24 +01:00
PowerShell is available from the [Arch Linux][] User Repository (AUR) as a [release][arch-release] or the [latest development build][arch-git].
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 ](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages ).
[Arch Linux]: https://www.archlinux.org/download/
[arch-release]: https://aur.archlinux.org/packages/powershell/
[arch-git]: https://aur.archlinux.org/packages/powershell-git/
2017-03-21 23:20:11 +01:00
## Linux AppImage
2016-08-23 02:37:43 +02:00
Using a recent Linux distribution,
2017-04-07 06:27:48 +02:00
download the AppImage `PowerShell-6.0.0-alpha.18-x86_64.AppImage`
2016-08-23 02:37:43 +02:00
from the [releases][] page onto the Linux machine.
Then execute the following in the terminal:
2017-03-21 23:20:11 +01:00
```bash
2017-04-07 06:27:48 +02:00
chmod a+x PowerShell-6.0.0-alpha.18-x86_64.AppImage
./PowerShell-6.0.0-alpha.18-x86_64.AppImage
2016-08-23 02:37:43 +02:00
```
The [AppImage][] lets you run PowerShell without installing it.
It is a portable application that bundles PowerShell and its dependencies
(including .NET Core's system dependencies) into one cohesive package.
This package works independently of the user's Linux distribution,
and is a single binary.
[appimage]: http://appimage.org/
2017-03-21 23:20:11 +01:00
## macOS 10.11
2016-03-31 08:29:16 +02:00
2016-09-03 02:16:35 +02:00
Using macOS 10.11, download the PKG package
2017-04-07 06:27:48 +02:00
`powershell-6.0.0-alpha.18-osx.10.11-x64.pkg`
2016-09-03 02:16:35 +02:00
from the [releases][] page onto the macOS machine.
2016-07-27 21:55:10 +02:00
2016-08-12 01:50:50 +02:00
Either double-click the file and follow the prompts,
or install it from the terminal:
2016-04-11 18:50:58 +02:00
```sh
2017-04-07 06:27:48 +02:00
sudo installer -pkg powershell-6.0.0-alpha.18-osx.10.11-x64.pkg -target /
2016-04-11 18:50:58 +02:00
```
2017-03-21 23:20:11 +01:00
### Uninstallation - macOS 10.11
2016-09-13 06:12:00 +02:00
PowerShell on MacOS must be removed manually.
To remove the installed package:
2016-09-20 01:34:23 +02:00
2016-09-13 06:12:00 +02:00
```sh
2016-09-20 01:34:23 +02:00
sudo rm -rf /usr/local/bin/powershell /usr/local/microsoft/powershell
2016-09-13 06:12:00 +02:00
```
2016-09-20 01:34:23 +02:00
To uninstall the additional PowerShell paths (such as the user profile path)
please see the [paths][paths] section below in this document
and remove the desired the paths with `sudo rm` .
2016-09-13 06:12:00 +02:00
2016-09-20 23:10:40 +02:00
[paths]:#paths
2017-03-21 23:20:11 +01:00
## OpenSSL
2016-09-03 02:16:35 +02:00
Also install [Homebrew's OpenSSL][openssl]:
2017-03-21 23:20:11 +01:00
```bash
2016-09-03 02:16:35 +02:00
brew install openssl
2016-09-20 23:26:07 +02:00
brew install curl --with-openssl
2016-09-03 02:16:35 +02:00
```
[Homebrew][brew] is the missing package manager for macOS.
If the `brew` command was not found,
you need to install Homebrew following [their instructions][brew].
.NET Core requires Homebrew's OpenSSL because the "OpenSSL" system libraries on macOS are not OpenSSL,
as Apple deprecated OpenSSL in favor of their own libraries.
This requirement is not a hard requirement for all of PowerShell;
however, most networking functions (such as `Invoke-WebRequest` )
do require OpenSSL to work properly.
**Please ignore** .NET Core's installation instructions to manually link the OpenSSL libraries.
This is **not** required for PowerShell as we patch .NET Core's cryptography libraries to find Homebrew's OpenSSL in its installed location.
Again, **do not** run `brew link --force` nor `ln -s` for OpenSSL, regardless of other instructions.
Homebrew previously allowed OpenSSL libraries to be linked to the system library location;
however, this created major security holes and is [no longer allowed][homebrew-patch].
Because .NET Core's 1.0.0 release libraries still look in the prior system location for OpenSSL,
they will fail to work unless the libraries are manually placed there (security risk),
or their libraries are patched (which we do).
To patch .NET Core's cryptography libraries, we use `install_name_tool` :
2017-03-21 23:20:11 +01:00
```bash
2016-09-03 02:16:35 +02:00
find ~/.nuget -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib
2016-09-20 23:26:07 +02:00
find ~/.nuget -name System.Net.Http.Native.dylib | xargs sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib
2016-09-03 02:16:35 +02:00
```
This updates .NET Core's library to look in Homebrew's OpenSSL installation location instead of the system library location.
The PowerShell macOS package come with the necessary libraries patched,
and the build script patches the libraries on-the-fly when building from source.
You *can* run this command manually if you're having trouble with .NET Core's cryptography libraries.
[openssl]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
[brew]: http://brew.sh/
[homebrew-patch]: https://github.com/Homebrew/brew/pull/597
2017-03-21 23:20:11 +01:00
## Paths
2016-08-01 22:46:48 +02:00
2017-04-07 06:27:48 +02:00
* `$PSHOME` is `/opt/microsoft/powershell/6.0.0-alpha.18/`
2016-08-11 23:26:33 +02:00
* User profiles will be read from `~/.config/powershell/profile.ps1`
* Default profiles will be read from `$PSHOME/profile.ps1`
* User modules will be read from `~/.local/share/powershell/Modules`
* Shared modules will be read from `/usr/local/share/powershell/Modules`
2016-08-12 01:50:50 +02:00
* Default modules will be read from `$PSHOME/Modules`
2017-03-28 01:44:28 +02:00
* PSReadline history will be recorded to `~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt`
2016-08-01 22:46:48 +02:00
2016-08-12 01:50:50 +02:00
The profiles respect PowerShell's per-host configuration,
so the default host-specific profiles exists at `Microsoft.PowerShell_profile.ps1` in the same locations.
2016-08-01 22:46:48 +02:00
2016-08-26 21:08:50 +02:00
On Linux and macOS, the [XDG Base Directory Specification][xdg-bds] is respected.
2016-08-02 01:32:16 +02:00
2016-08-26 21:08:50 +02:00
Note that because macOS is a derivation of BSD,
2016-08-12 01:50:50 +02:00
instead of `/opt` , the prefix used is `/usr/local` .
2017-04-07 06:27:48 +02:00
Thus, `$PSHOME` is `/usr/local/microsoft/powershell/6.0.0-alpha.18/` ,
2016-08-12 01:50:50 +02:00
and the symlink is placed at `/usr/local/bin/powershell` .
2016-08-02 01:33:47 +02:00
[releases]: https://github.com/PowerShell/PowerShell/releases/latest
[xdg-bds]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html