PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Error while installing the powershell in ubuntu 20.04

Open imskanand opened this issue 3 years ago • 4 comments

Prerequisites

Steps to reproduce

Not able to install in ubuntu 20.04

Expected behavior

Installation

Actual behavior

Fatel error

Error details

Unpacking powershell-lts (7.2.7-1.deb) ...
dpkg: error processing archive /home/imskanand/Downloads/powershell-lts_7.2.7-1.deb_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/pwsh', which is also in package powershell 7.2.3-1.deb
Errors were encountered while processing:
 /home/imskanand/Downloads/powershell-lts_7.2.7-1.deb_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Environment data

NOTHING Available

Visuals

No response

imskanand avatar Oct 22 '22 13:10 imskanand

I don't use any package managers and everything works fine. Just unpack to /opt/microsoft/powershell/7/ and symlink pwsh to the $PATH, in /usr/bin for example. Forget about dpgg or apt

237dmitry avatar Oct 22 '22 14:10 237dmitry

You can also try installing via the snap store, sudo snap install powershell --classic

StevenBucher98 avatar Oct 31 '22 16:10 StevenBucher98

The problem is trying to replace "powershell" with "powershell-lts". Both apt and dpkg will see them as two different packages as they have different package names.

trying to overwrite '/usr/bin/pwsh', which is also in package powershell 7.2.3-1.deb

Solution is to remove "powershell" 7.2.3 first or upgrade with "powershell" 7.2.7 instead of "powershell-lts" 7.2.7

rhubarb-geek-nz avatar Nov 05 '22 06:11 rhubarb-geek-nz

I don't use any package managers and everything works fine. Just unpack to /opt/microsoft/powershell/7/ and symlink pwsh to the $PATH, in /usr/bin for example. Forget about dpgg or apt

I would recommend using packages.

  • They ensure the package dependencies are installed.
  • They let you see exactly what is installed on your system in one place.
  • When you upgrade the obsolete files are removed.
  • It manages the entries in /etc/shells
  • You get a working man page

rhubarb-geek-nz avatar Nov 06 '22 01:11 rhubarb-geek-nz

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.