Error while installing the powershell in ubuntu 20.04
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest released version
- [X] Search the existing issues.
- [X] Refer to the FAQ.
- [X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.
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
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
You can also try installing via the snap store, sudo snap install powershell --classic
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
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/binfor example. Forget aboutdpggorapt
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
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.