Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4063 - fix Ubuntu 18.04 setup steps & PS vers #4131

Merged
merged 2 commits into from
Apr 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ms.date: 08/06/2018

# Installing PowerShell Core on Linux

Supports [Ubuntu 14.04][u14], [Ubuntu 16.04][u16], [Ubuntu 18.04][u1804], [Ubuntu 18.10][u1810], [Debian 8][deb8], [Debian 9][deb9],
[CentOS 7][cos], [Red Hat Enterprise Linux (RHEL) 7][rhel7], [openSUSE 42.3][opensuse], [openSUSE Leap 15][opensuse], [Fedora 27][fedora],
[Fedora 28][fedora], and [Arch Linux][arch].
Supports [Ubuntu 14.04][u14], [Ubuntu 16.04][u16], [Ubuntu 18.04][u1804], [Ubuntu 18.10][u1810], [Debian 9][deb9],
[CentOS 7][cos], [Red Hat Enterprise Linux (RHEL) 7][rhel7], [openSUSE 42.3][opensuse], [openSUSE Leap 15][opensuse],
[Fedora 27][fedora], [Fedora 28][fedora], and [Arch Linux][arch].

For Linux distributions that are not officially supported,
you can try using the [PowerShell Snap Package][snap].
Expand All @@ -22,7 +22,6 @@ Once the package is installed, run `pwsh` from a terminal.
[u16]: #ubuntu-1604
[u1804]: #ubuntu-1804
[u1810]: #ubuntu-1810
[deb8]: #debian-8
[deb9]: #debian-9
[cos]: #centos-7
[rhel7]: #red-hat-enterprise-linux-rhel-7
Expand Down Expand Up @@ -77,13 +76,13 @@ From then on, you just need to use `sudo apt-get upgrade powershell` to update t
### Installation via Direct Download - Ubuntu 14.04

Download the Debian package
`powershell_6.1.0-1.ubuntu.14.04_amd64.deb`
`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:

```sh
sudo dpkg -i powershell_6.1.0-1.ubuntu.14.04_amd64.deb
sudo dpkg -i powershell_6.2.0-1.ubuntu.14.04_amd64.deb
sudo apt-get install -f
```

Expand Down Expand Up @@ -128,13 +127,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
### Installation via Direct Download - Ubuntu 16.04

Download the Debian package
`powershell_6.1.0-1.ubuntu.16.04_amd64.deb`
`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:

```sh
sudo dpkg -i powershell_6.1.0-1.ubuntu.16.04_amd64.deb
sudo dpkg -i powershell_6.2.0-1.ubuntu.16.04_amd64.deb
sudo apt-get install -f
```

Expand Down Expand Up @@ -166,6 +165,9 @@ 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

Expand All @@ -179,13 +181,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
### Installation via Direct Download - Ubuntu 18.04

Download the Debian package
`powershell_6.1.0-1.ubuntu.18.04_amd64.deb`
`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:

```sh
sudo dpkg -i powershell_6.1.0-1.ubuntu.18.04_amd64.deb
sudo dpkg -i powershell_6.2.0-1.ubuntu.18.04_amd64.deb
sudo apt-get install -f
```

Expand Down Expand Up @@ -239,30 +241,6 @@ 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.

### Installation via Direct Download - Debian 8

Download the Debian package
`powershell_6.1.0-1.debian.8_amd64.deb`
from the [releases][] page onto the Debian machine.

Then execute the following in the terminal:

```sh
sudo dpkg -i powershell_6.1.0-1.debian.8_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.

### Uninstallation - Debian 8

```sh
sudo apt-get remove powershell
```

## Debian 9

### Installation via Package Repository - Debian 9
Expand Down Expand Up @@ -297,13 +275,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
### Installation via Direct Download - Debian 9

Download the Debian package
`powershell_6.1.0-1.debian.9_amd64.deb`
`powershell_6.2.0-1.debian.9_amd64.deb`
from the [releases][] page onto the Debian machine.

Then execute the following in the terminal:

```sh
sudo dpkg -i powershell_6.1.0-1.debian.9_amd64.deb
sudo dpkg -i powershell_6.2.0-1.debian.9_amd64.deb
sudo apt-get install -f
```

Expand Down Expand Up @@ -339,19 +317,19 @@ you just need to use `sudo yum update powershell` to update PowerShell.
### Installation via Direct Download - CentOS 7

Using [CentOS 7][], download the RPM package
`powershell-6.1.0-1.rhel.7.x86_64.rpm`
`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:

```sh
sudo yum install powershell-6.1.0-1.rhel.7.x86_64.rpm
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:

```sh
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
```

### Uninstallation - CentOS 7
Expand Down Expand Up @@ -385,19 +363,19 @@ you just need to use `sudo yum update powershell` to update PowerShell.
### Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7

Download the RPM package
`powershell-6.1.0-1.rhel.7.x86_64.rpm`
`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:

```sh
sudo yum install powershell-6.1.0-1.rhel.7.x86_64.rpm
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:

```sh
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
```

### Uninstallation - Red Hat Enterprise Linux (RHEL) 7
Expand All @@ -415,19 +393,19 @@ sudo yum remove powershell
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.1.0/powershell-6.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
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.1.0
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.1.0
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0

# Set execute permissions
chmod +x /opt/microsoft/powershell/6.1.0/pwsh
chmod +x /opt/microsoft/powershell/6.2.0/pwsh

# Create the symbolic link that points to pwsh
ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh
ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh

# Start PowerShell
pwsh
Expand All @@ -440,19 +418,19 @@ pwsh
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.1.0/powershell-6.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
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.1.0
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.1.0
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0

# Set execute permissions
chmod +x /opt/microsoft/powershell/6.1.0/pwsh
chmod +x /opt/microsoft/powershell/6.2.0/pwsh

# Create the symbolic link that points to pwsh
ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh
ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh

# Start PowerShell
pwsh
Expand Down Expand Up @@ -496,21 +474,21 @@ pwsh
### Installation via Direct Download - Fedora 27, Fedora 28

Download the RPM package
`powershell-6.1.0-1.rhel.7.x86_64.rpm`
`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:

```sh
sudo dnf install compat-openssl10
sudo dnf install powershell-6.1.0-1.rhel.7.x86_64.rpm
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:

```sh
sudo dnf install compat-openssl10
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-1.rhel.7.x86_64.rpm
```

### Uninstallation - Fedora 27, Fedora 28
Expand Down Expand Up @@ -632,13 +610,13 @@ Download [Raspbian Stretch](https://www.raspberrypi.org/downloads/raspbian/) and
sudo apt-get install libunwind8

# Grab the latest tar.gz
wget https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-arm32.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.1.0-linux-arm32.tar.gz -C ~/powershell
tar -xvf ./powershell-6.2.0-linux-arm32.tar.gz -C ~/powershell

# Start PowerShell
~/powershell/pwsh
Expand Down Expand Up @@ -701,19 +679,19 @@ and then extracts the Linux `tar.gz` archive.

```sh
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz
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.1.0
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.1.0
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.0

# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/6.1.0/pwsh
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.1.0/pwsh /usr/bin/pwsh
sudo ln -s /opt/microsoft/powershell/6.2.0/pwsh /usr/bin/pwsh
```

### Uninstalling binary archives
Expand All @@ -724,7 +702,7 @@ sudo rm -rf /usr/bin/pwsh /opt/microsoft/powershell

## Paths

* `$PSHOME` is `/opt/microsoft/powershell/6.1.0/`
* `$PSHOME` is `/opt/microsoft/powershell/6.2.0/`
* 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`
Expand Down