Powershell: Snap broken in distros not Ubuntu - Unable to find module repositories.

Created on 25 Feb 2020  Â·  2Comments  Â·  Source: PowerShell/PowerShell

Steps to reproduce

Install Powershell using snapd

Expected behavior

Would expect to be able to download and install modules

Actual behavior

Works as expected under Ubuntu. Have tested on CentoOS, Fedora and Arch. All broken.

For example, if I attempt to install the module az under Ubuntu it works. On the distros listed above I get the following error...

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'az'. Try Get-PSRepository to see all available registered module repositories.
At /var/lib/snapd/snap/powershell/88/opt/powershell/Modules/PowerShellGet/PSModule.psm1:9508 char:21

  • ... $null = PackageManagement\Install-Package @PSBoundParameters
  • ~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Microsoft.PowerShel\u2026lets.InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Running Get-PSRepository results in...

WARNING: Unable to find module repositories..

Environment data

Name Value
---- -----
PSVersion 6.2.4
PSEdition Core
GitCommitId 6.2.4
OS Linux 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Fe…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Issue-Question

All 2 comments

Just to add to this - Ubuntu 20.04 is broken as well. After testing the snap on numerous distros, it appears to only work on Ubuntu 18.04. Why on earth are you bothering to publish a snap if it isn't going to be distro agnostic. That's like the entire point.

Also not to pile on, but there are no 20.04 packages available in the apt repository either.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andschwa picture andschwa  Â·  64Comments

DarwinJS picture DarwinJS  Â·  65Comments

NJ-Dude picture NJ-Dude  Â·  64Comments

Ciantic picture Ciantic  Â·  90Comments

msftrncs picture msftrncs  Â·  62Comments