Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Install PowerShell on Ubuntu 18.04 beta

CJ edited this page Sep 15, 2018 · 27 revisions

Note: Microsoft has released powershell_6.1.0-1.ubuntu.18.04_amd64.deb for Ubuntu 18.04

The steps below let you install previous PowerShell 6.0.x packages on Ubuntu 18.04. Instead of downgrading to libcurl3, this procedure lets you keep libcurl4:

1. Download the libicu57 dependency

cd /tmp
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu57_57.1-6ubuntu0.3_amd64.deb

2. Download the latest PowerShell package

Get powershell_6.0.2-1.ubuntu.17.04_amd64.deb from the releases page onto the Ubuntu machine.

wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.2/powershell_6.0.2-1.ubuntu.17.04_amd64.deb

3. Extract the PowerShell package to a folder

dpkg-deb --raw-extract powershell_6.0.2-1.ubuntu.17.04_amd64.deb pwsh-patched

4. Change the dependency to libcurl4

sed --in-place 's/curl3/curl4/g' pwsh-patched/DEBIAN/control

5. Re-Package the PowerShell package

dpkg-deb --build pwsh-patched powershell-patched_6.0.2-1.ubuntu.18.04_amd64.deb

6. Install both packages

In this order:

sudo apt install -f ./libicu57_57.1-6ubuntu0.3_amd64.deb
sudo apt install -f ./powershell-patched_6.0.2-1.ubuntu.18.04_amd64.deb

7. Run the pwsh command

Start PowerShell Core on Linux:

pwsh

and verify the installed version:

PS /tmp> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.2
PSEdition                      Core
GitCommitId                    v6.0.2
OS                             Linux 4.15.0-15-generic #16-Ubuntu SMP Wed Apr 4 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Acknowledgements:

Solution to retain curl4 instead of curl3 downgrade provided by tohuw:

Kudos to Tim De Pauw for figuring out this exact libcurl3 dependency problem for another package, and @borgdylan for suggesting this same fix for dotnet

Clone this wiki locally