Unable to upgrade Powershell on Debian system.

Priest_Apostate

Active Member
Joined
Nov 7, 2023
Messages
197
Reaction score
47
Credits
2,117
I'm using Debian 12 on my Lenovo IdeaPad Slim 5 system, and currently I am experiencing issues in upgrading my Powershell install to the system.
Using these commands:
1.
Code:
apt-get update && sudo apt-get dist-upgrade
2.
Code:
apt-get update && sudo apt-get upgrade
or
3. The command
Code:
"Install-Module -Name pwsh -Force -AllowClobber -Scope CurrentUser"
from within Powershell - none of the above commands work.

1747155567415.png


The system and logs seem to indicate that the command was accepted, as no error messages were generated - but I still have the old version.

The link shown in the message (https://github.com/PowerShell/PowerShell/releases/tag/v7.5.1) brings the hash values, and various packages, leading me to believe that this is the only area by which to install the updated version. As I'm wanting the update to complete with the system updates, I don't think that doing so via this method would work.

Would anyone happen to have any other suggestions on how to get this to upgrade to successfully complete?
 

Attachments

  • 1747155523308.png
    1747155523308.png
    68.3 KB · Views: 222


It does not have a repo, nor does it install a repo. You'll have to upgrade manually each time there's a new version.

I have no idea if it will prompt you to tell you when there's a new version.

Anyhow, go to their GitHub page and you'll see 'Releases' on the right. Click that, download the .deb, and see if you can get that to install. You can navigate to your download location in the terminal and then use sudo apt install <file_name>.deb to install the package, if you'd like.

When there's a new version, just repeat the process. The file's provided on the "Releases" page will update accordingly and you'll just use that link to grab the .deb package.

The current (this will change) URL for that would be here:


Scroll down and you'll see:

"powershell_7.5.1-1.deb_amd64.deb"

That's the download you want.

Out of curiosity, what's the benefit to installing PowerShell in Linux? I am not one of them, but many Linux users abhore all things Microsoft. I am guessing that you have a specific reason for doing this. As far as I know, you're the only person to have posted here about installing PowerShell - in all the time I've been here.
 
Out of curiosity, what's the benefit to installing PowerShell in Linux? I am not one of them, but many Linux users abhore all things Microsoft. I am guessing that you have a specific reason for doing this. As far as I know, you're the only person to have posted here about installing PowerShell - in all the time I've been here.

Short answer: forced to by capitalism!

I am in the same boat regarding Windows: I switched over to Linux on all of my systems, as Windows' sense of boundaries regarding my personal data leaves a bit to be desired (my personal information was backed up to the cloud after an update turned the feature back on - without informing me that it did so).

Having that said, I'm trying to prevent my current knowledge from atrophying, for job-hunting purposes (I work currently as an Azure Network Engineer).
I am also studying Terraform and Python towards the same end.
 
Last edited:
@Priest_Apostate
You need to add MS repository to install PS using apt, for instructions see:

^ THIS

I missed it on their GitHub page.

Edited to add:

(my personal information was backed up to the cloud after an update turned the feature back on - without informing me that it did so

That's absolutely horrible. Knowing MSFT, it was probably in the fine print somewhere you weren't expected to look. (Very few people read all the bulletins that go with their updates.) They're keen on covering themselves from a legal viewpoint and some nations have pretty strong privacy laws.

I've been MSFT free for quite a while now. I do not miss it. I'm not even sure how to use their OS anymore as it has been quite a few releases since I last used a Windows PC.
 
I use Azure almost everyday, I haven't really seen anything I can do in powershell that I can't do in bash, terraform, bicep, or az-cli. (Usually a combination of two or more of these).
 
I haven't really seen anything I can do in powershell that I can't do in bash
You can't use classes and UI in bash.
bash also has no enums and a bunch of other language constructs that PS has.

I don't know if all these things are available in PS for Linux though.
The only true downside to PS vs bash is that PS slow as f because is based on MS corporate bloatware called .NET
 
You can simulate classes and enums in bash. But what I meant was, as far as provisioning VMs, resource groups, networks, appGateways, etc... I haven't found anything I specifically needed powershell for in Azure.
 
You can simulate classes and enums in bash. But what I meant was, as far as provisioning VMs, resource groups, networks, appGateways, etc... I haven't found anything I specifically needed powershell for in Azure.
So that I understand that correctly: you're able to run bash on your physical system, to deploy and manage resources within Azure? I've also been looking into that for Python - but your answer piqued my curiosity...
 
That's absolutely horrible. Knowing MSFT, it was probably in the fine print somewhere you weren't expected to look. (Very few people read all the bulletins that go with their updates.) They're keen on covering themselves from a legal viewpoint and some nations have pretty strong privacy laws.

I've been MSFT free for quite a while now. I do not miss it. I'm not even sure how to use their OS anymore as it has been quite a few releases since I last used a Windows PC.

I'm not missing it either; I use it for work - so I haven't felt much need for setting up a home system for practice. That might change in the near future, though.
 


Follow Linux.org

Members online


Top