3

In Ubuntu 19.04 sudo apt install powershell fails with

The following packages have unmet dependencies:
 powershell : Depends: libssl1.0.0 but it is not installable
              Depends: libicu60 but it is not installable

Installing it with snap install powershell --classic works, but then it doesn't show up in /etc/shells so chsh doesn't work.

How to fix this?

rzippo
  • 133
  • 1
  • 6

1 Answers1

9

To install Powershell using Snap

  • Run

    sudo snap install powershell --classic
    

To install Powershell using APT

Microsoft updated their documentation on 08/06/2018 in which they described steps for 18.04. Their repositories for Powershell are neither updated for 18.10 nor for 19.04.

In default repository of 19.04, libssl is now at version 1.1.1 and libcu is now at version 63. So, in order to use bionic's package, bionic's dependencies need to be used.

  • Install dependencies using dpkg:

    wget http://mirrors.edge.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
    sudo dpkg -i libicu60_60.2-3ubuntu3_amd64.deb libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
    
  • Add Microsoft's repository information:

    sudo nano /etc/apt/sources.list.d/microsoft-prod.list
    

    Add the content below and save that using Ctrl+X followed by Y.

    deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
    
  • Update and install Powershell

    sudo apt update
    sudo apt install powershell
    

To set Powershell as default shell:

  • Check if the path of Powershell is in /etc/shells. If not, add that. For Snap installation it is /snap/bin/pwsh and for packages installed via APT, it is /usr/bin/pwsh.

  • Run chsh and enter password.

  • Enter the path of Powershell.
  • Re-login or reboot.
Kulfy
  • 18,154