Giter Club home page Giter Club logo

powershell-snap's Introduction

Project
PowerShell

This is the snap for PowerShell, "PowerShell for every system". It works on Ubuntu, Fedora, Debian, and other major Linux distributions.

Install

sudo snap install powershell --classic
sudo snap install powershell-preview --classic

(Don't have snapd installed?)

Known Issues

  • Ubuntu 20.04 is not working with the powershell package.
    • The work around is to use the powershell-preview package.
  • Some native libaries cause incompatible libarires to be loaded. Because the snap file system the readonly, there is no real workaround for this.
    • libmi always causes for this type of issue and is responsible for:
      • PowerShell remoting commands that don't invole -Hostname

Alias Troubleshooting

  • Run whereis pwsh-preview if, /snap/bin/pwsh-preview is not returned, Snap has not created the alias.
  • If Snap has created the alias, and it is not working, you may need to reboot (or logout and back in) before it will work.
  • If Snap has not created the alias, you can create the alias with sudo snap alias <packagename> <aliasname>

powershell-snap's People

Contributors

anamnavi avatar cjp256 avatar dependabot[bot] avatar evandandrea avatar flexiondotorg avatar popey avatar step-security-bot avatar stevel-msft avatar travisez13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

powershell-snap's Issues

/run/user/1000/snap.powershell[-preview] socket dir does not exist

From PowerShell/PowerShell#7374. VSCode would start from bash but not from PowerShell (snap version).

The relevant error is:

PS > code --verbose
Gtk-Message: 11:41:03.358: Failed to load module "canberra-gtk-module"
[3182:0808/114103.715054:ERROR:sandbox_linux.cc(343)] InitializeSandbox() called with multiple threads in process gpu-process.
[main 11:41:03 AM] Error: listen EACCES /run/user/1000/snap.powershell-preview/vscode-50fc40ed-1.25.1-main.sock
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at Server.setupListenHandle [as _listen2] (net.js:1247:19)
    at listenInCluster (net.js:1304:12)
    at Server.listen (net.js:1413:5)
    at /usr/share/code/resources/app/out/vs/code/electron-main/main.js:166:570
    at new n.Class.derive._oncancel (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:90:378)
    at Object.t.serve (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:166:500)
    at n (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:519:985)
    at J (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:522:235)
    at e.invokeFunction (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:203:400)
    at /usr/share/code/resources/app/out/vs/code/electron-main/main.js:523:392
    at Object.enter (/usr/share/code/resources/app/out/vs/code/electron-main/mai    at n.Class.derive._oncancel._run (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:88:719)
    at n.Class.derive._oncancel._completed (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:88:160)
    at u (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:91:654)
    at H.then.o.(anonymous function) (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:91:868)
    at Object.v [as _notify] (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:83:572)
    at Object.enter (/usr/share/code/resources/app/out/vs/code/electron-main/mai    at n.Class.derive._oncancel._run (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:88:719)
    at n.Class.derive._oncancel._completed (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:88:160)
    at /usr/share/code/resources/app/out/vs/code/electron-main/main.js:119:295
    at FSReqWrap.oncomplete (fs.js:114:15)
[main 11:41:03 AM] Lifecycle#kill()

VSCode had a similar problem (microsoft/vscode#44758), fixed in microsoft/vscode@9d75305.

The workaround is to do mkdir -p /run/user/1000/snap.powershell[-preview]/, but not sure of the best way to fix this in our case.

PowerShell RC.2 not available in Snap for Ubuntu 18.04

I try to upgrade from RC.1 to RC.2 using snap but is not available.

Steps to reproduce

In Linux Ubuntu 18.04.
Remove PowerShell

sudo snap remove powershell-preview 
sudo snap install powershell-preview --classic

Also try:

sudo snap refresh powershell-preview --classic

Expected behavior

To open PowerShell 7 RC.2


Actual behavior

Opens PowerShell 7 RC.1


Environment data

Linux OS - 18.04


PRC@_2020-01-17_17-01-03

snap package fails on ubuntu 20.04

Installing powershell on ubuntu 20.04:

sudo snap install powershell --classic
powershell 7.0.0 from Microsoft PowerShell✓ installed
pwsh
Failed to load ���, error: /snap/powershell/104/opt/powershell/../../lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
Failed to bind to CoreCLR at '/snap/powershell/104/opt/powershell/'
Failed to create CoreCLR, HRESULT: 0x80008088

Reopened because @msftbot closed the issue within 24h.

Cannot set as login shell without manually adding to `/etc/shells`.

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

As https://github.com/orgs/PowerShell/discussions/20962#discussioncomment-7937685 describes, the Snap package cannot be set as the login shell via chsh -s $Shell (where $Shell is the absolute path to the shell binary) without the user manually adding its path to /etc/shells. However, the native (.RPM) package automatically adds itself to that file as every other shell does. For instance, on my system, when the correct path for the snap package has been added, the content of /etc/shells is:

PS /home/RokeJulianLockhart> cat -vbET '/etc/shells'
     1  /bin/ash$
     2  /bin/bash$
     3  /bin/csh$
     4  /bin/dash$
     5  /bin/false$
     6  /bin/ksh$
     7  /bin/ksh93$
     8  /bin/mksh$
     9  /bin/pdksh$
    10  /bin/sh$
    11  /bin/tcsh$
    12  /bin/true$
    13  /bin/zsh$
    14  /usr/bin/csh$
    15  /usr/bin/dash$
    16  /usr/bin/ksh$
    17  /usr/bin/ksh93$
    18  /usr/bin/mksh$
    19  /usr/bin/passwd$
    20  /usr/bin/pdksh$
    21  /usr/bin/bash$
    22  /usr/bin/tcsh$
    23  /usr/bin/zsh$
    24  /usr/bin/fish$
    25  /usr/bin/scsh$
    26  /usr/bin/rash$
    27  /snap/powershell/current/opt/powershell/pwsh$
PS /home/RokeJulianLockhart> # This demonstrates correct manual addition of the path to the snap package rather than what the RPM package does.

Consequently, the installation process needs to add the path, and the uninstallation process remove it. The path should obviously be the vanity path as aforedepicted, not the mount-specific path, as #101 (comment) explains.

Expected behaviour

The aforestated command should set it as the login shell.

Actual behaviour

It does not.

Error details

PS /home/RokeJulianLockhart> Get-Command pwsh                      

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     pwsh                                               0.0.0.0    /snap/powershell/261/opt/powershell/pwsh

PS /home/RokeJulianLockhart> chsh -s /snap/powershell/261/opt/powershell/pwsh
Password: 
chsh: /snap/powershell/261/opt/powershell/pwsh is an invalid shell
PS /home/RokeJulianLockhart> Get-Error       
PS /home/RokeJulianLockhart> chsh -s /snap/powershell/261/opt/powershell/pwsh
Password: 
chsh: /snap/powershell/261/opt/powershell/pwsh is an invalid shell
PS /home/RokeJulianLockhart> $?                   
False
PS /home/RokeJulianLockhart>

Environment data

PS /home/RokeJulianLockhart> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             openSUSE Tumbleweed
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /home/RokeJulianLockhart>

Version

{
	"version": "7.4.0",
	"channel": "latest/stable",
	"snap-id": "JSNnoJl3EqkMuWoy5Dgq8PMqZ0uNcpie"
}

Visuals

No response

System.Security.Cryptography.SHA256Cng fails to load

Steps to reproduce

09:52:41 evil@P950ER ~/Downloads» pwsh
PowerShell 6.2.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /data/Downloads> install-module Microsoft.Graph.Intune
PS /data/Downloads> Import-Module Microsoft.Graph.Intune
PS /data/Downloads> Connect-MSGraph

Expected behavior

I expected to be prompted for credentials and connect to the graph API.

Actual behavior

Connect-MSGraph : Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
At line:1 char:1
+ Connect-MSGraph
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-MSGraph], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Connect

Environment data

----                           -----
PSVersion                      6.2.2
PSEdition                      Core
GitCommitId                    6.2.2
OS                             Linux 5.2.0-8-generic PowerShell/PowerShell#9-Ubuntu SMP Mon Jul 8 13:07:27 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

This was tested with the current snap and current Ubuntu 19.10 (Eoan Ermine) repos.

Issue when PowerShell Snap is trying to capture the output of a command line application that is installed in another snap

This will probably be a bit complicated to explain but I'll do my best.
I'm running ubuntu 20.10 see my system's info below.

PS /home/dm/Git> snap --version            
snap    2.47.1+20.10.1
snapd   2.47.1+20.10.1
series  16
ubuntu  20.10
kernel  5.8.0-29-generic

I have the latest version of Powershell installed as a snap

PS /home/dm/Git> snap list |grep powershell
powershell         7.1.0                       149    latest/stable    microsoft-powershell*  classic

The below screenshot should show what I was trying to do
I tried to capture the output of the /snap/bin/bw command in a variable.
image

when I ran the command by itself it seemed to work properly.

If you have any questions or want my help in further debugging the issue please let me know.

I did additional testing and found out that it seems to happen in other snaps
to reproduce you the issue you can run the following Steps

  1. Install PowerShell as a snap sudo snap install --classic powershell
  2. Install Azure CLI as a snap sudo snap install --candidate azure-cli
  3. Run PowerShell using pwsh
  4. in PowerShell Run the following command $a = azure-cli
    you should get the following error

image

[Ubuntu 20.04] Installing powershell snap creates incorrect icon/launcher in "Show Applications"

Steps to reproduce

On Ubuntu 20.04, install Powershell snap

snap install powershell --classic

click on "Show Applications" in the dock. This shows a list of all installed applications.

Expected behavior

  1. The icon for Powershell should be shown.
  2. Clicking the icon should launch Powershell.

Actual behavior

  1. The icon shown is incorrect - it is for "Powershell Preview"
  2. Clicking the icon shows an error message:
Failed to launch "PowerShell Preview"
Desktop file didn't specify Exec field

Removing the Powershell snap does remove the incorrect icon from the list of applications, but clicking on "Show Applications" causes the Gnome Shell to crash.

Environment data

Ubuntu Desktop 20.04, PowerShell 7.0.3

All channels of preview snap package except latest/stable are old.

Prerequisites

Steps to reproduce

snap install powershell-preview + (--channel=latest/edge or --channel=latest/beta or --channel=latest/candidate).

Expected behavior

All should at least provide the same version. Edge should probably compile directly from git. Either that, or remove the channels.

Actual behavior

image

Ubuntu 21.04 both powershell and powershell-preview fail to start

Fresh installation of Ubuntu Hirsute Hippo, after installing powershell or powershell-preview attempting to run pwsh (or pwsh-preview) attempt to load the shell but fails with:

❯ pwsh-preview
PowerShell 7.2.0-preview.7
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell                                                                                                                               │
Type 'help' to get help.

PS /home/user> No usable version of libssl was found
zsh: IOT instruction (core dumped)  pwsh-preview

anyway to know what library version it's looking for and if there is a dependency that isn't automatically detected/installer?

Update screenshots on the snap store listing for PowerShell 7.0

See https://twitter.com/Steve_MSFT/status/1237512453593812997

There are 3 media components to the listing:

  • Screen shots with the following requirements:
Accepted image formats include: GIF, JPEG & PNG files
Min resolution: 480 x 480 pixels
Max resolution: 3840 x 2160 pixels
Aspect ratio: Between 1:2 and 2:1
File size limit: 2MB
Animation min fps: 1
Animation max fps: 30
Animation max length: 40 seconds
  • Feature Banner
Accepted image formats include: JPEG & PNG files
Min resolution: 720 x 240 pixels
For best results on the store we recommend a resolution of 1920 x 640 pixels or greater
Max resolution: 4320 x 1440 pixels
Aspect ratio: 3:1
File size limit: 2MB
  • Video
Vimeo, YouTube or asciinema URL

There are two text components:

  1. Summary

    PowerShell for every system!

  2. Description

    PowerShell is an automation and configuration management platform.
    It consists of a cross-platform (Windows, Linux, and macOS)
    command-line shell and associated scripting language.

Unable to create profiles for "AllUsers"

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

I am trying to create a $PROFILE.AllUsersAllHosts profile. It is not possible to create the profile because $PSHOME points to /snap/powershell/264/opt/powershell, which is read-only and therefore $PROFILE.AllUsersAllHosts points to /snap/powershell/264/opt/powershell/profile.ps1 instead of /opt/microsoft/powershell/7/profile.ps1, which is the location if powershell is installed with apt. For Ubuntu 24.04 the apt version is not yet available, it needs package libicu72 (ubuntu 22.04, jammy) while Ubuntu 24.04 uses libicu74 (noble) and libicu72 is not available anymore.

It seems to me that if the snap gets updated to version 265, the profile would be lost, because then $PSHOME would point to /snap/powershell/264/opt/powershell

Expected behavior

It should be possible to create the profiles $PROFILE.AllUsersAllHosts and $PROFILE.AllUsersCurrentHost

Actual behavior

PS> sudo cp ./Projects/PowerShell/profile.allusersallhosts.ps1 $PROFILE.AllUsersAllHosts
cp: cannot create regular file '/snap/powershell/264/opt/powershell/profile.ps1': Read-only file system

Error details

No response

Environment data

PS> $PSVersionTable          

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Ubuntu Noble Numbat (development branch)
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

264

Visuals

No response

Unable to fetch arm64 release

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

sudo snapd install powershell-preview --classic

Expected behavior

Powershell available for arm64 (Armbian_22.05.4_Pine64_jammy)

Actual behavior

No arm64 release available

Error details

//

Environment data

//

Version

//

Visuals

Screenshot (53)

error: snap "powershell" is not available on stable for this architecture (arm64)

Install PowerShell on Linux does not mention Ubuntu 19.10.

I tried the 19.04 instructions instead, but it fails saying there is no PowerShell snap for arm64.

I'm running Ubuntu 19.10 Server on a Raspberry Pi 4 (so, ARM64).

Steps to reproduce

ubuntu@ubuntu:~$ sudo snap install powershell --classic
error: snap "powershell" is not available on stable for this architecture (arm64) but exists on other architectures (amd64).

Expected behavior

Expect there to be a PowerShell snap for ARM64.

Actual behavior

error: snap "powershell" is not available on stable for this architecture (arm64) but exists on other architectures (amd64).

Environment data

ubuntu@ubuntu:~$ hostnamectl
   Static hostname: ubuntu
         Icon name: computer
        Machine ID: c2e737ec4d1d40f8b7e6c381f9453a62
           Boot ID: 3f28773124a74a11b72e69a815d6c07d
  Operating System: Ubuntu 19.10
            Kernel: Linux 5.3.0-1014-raspi2
      Architecture: arm64

Module repository issues on Arch-based distros

When installing the powershell package via snap on Ubuntu the default repository is registered out of the box and modules can be installed. When installing on an Arch-based distro however, no repository is present. In addition no repository is added when adding the default repository via
Register-PSRepository -Default

This results in the following error when trying to install modules:

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'AWSPowershell.NetCore'. Try Get-PSRepository to see all available registered module repositories.
At /var/lib/snapd/snap/powershell/39/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

Unable to start PowerShell | openSUSE Tumbleweed

I've installed PoweShell using commands from THIS SITE and after that I receive this error when I try to run pwsh

~> pwsh
Failed to load �V, error: /snap/powershell/104/opt/powershell/../../lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
Failed to bind to CoreCLR at '/snap/powershell/104/opt/powershell/'
Failed to create CoreCLR, HRESULT: 0x80008088

Unable to install modules from Powershell installed via snap

Steps to reproduce

Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force 

Expected behavior

Install the module posh-git

Actual behavior

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'posh-git'. Try Get-PSRepository to see all available registered module repositories.
At /var/lib/snapd/snap/powershell/17/opt/powershell/Modules/PowerShellGet/PSModule.psm1:9491 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Additional Data

> Get-PSRepository                                                  
OUTPUT :
WARNING: Unable to find module repositories.


> Get-PSRepository                                                  
WARNING: Unable to find module repositories.

Environment data

Name                           Value
----                           -----
PSVersion                      6.1.2
PSEdition                      Core
GitCommitId                    6.1.2
OS                             Linux 4.20.4-arch1-1-ARCH #1 SMP PREEMPT Wed Jan 23 00:12:22 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


Desktop file didn't specify Exec field

Hi

I just tried to launch powershell 7.0 from the gnome desktop applications on an Ubuntu 19.10 based system. I get a popup Desktop file didn't specify Exec field.

Looking in the desktop file under /var/lib/snapd/desktop/applications/powershell_powershell-preview.desktop I see:

[Desktop Entry]
X-SnapInstanceName=powershell
Name=PowerShell Preview
Type=Application
Terminal=true
Categories=ConsoleOnly;System
Icon=/snap/powershell/104/meta/gui/icon.png

To fix it I need to add Exec=/snap/bin/pwsh like so:

[Desktop Entry]
X-SnapInstanceName=powershell
Name=PowerShell Preview
Type=Application
Terminal=true
Categories=ConsoleOnly;System
Icon=/snap/powershell/104/meta/gui/icon.png
Exec=/snap/bin/pwsh

I'm not quite sure how I ended up on preview as I had 6.X stable installed, but that isn't the end of the world. The file at

does have an Exec field, so I'm not sure where this is going missing. I'm also not sure if this affects older versions, I don't tend to launch powershell from the applications menu in gnome.

FYI: Snap - Kernel 6.0 Bug

Problem

After a few hours of using the PowerShell snap with a 6.0 kernel, new shells cannot be opened with the following error:

pwsh: /snap/core20/current/lib/x86_64-linux-gnu/libdl.so.2: unsupported version 
0 of Verdef record
pwsh: error while loading shared libraries: /snap/core20/current/lib/x86_64-linu
x-gnu/libdl.so.2: unsupported version 0 of Verneed record

There is a bug in the SquashFS code that is affecting all Ubuntu Snaps including the PowerShell Snap on Linux. Affected Linux kernels are versions 6.0.0 through 6.0.6.

Solution

The solution is one of:

  • Install a LTS kernel.
  • Upgrade to a stable kernel version 6.0.7 or higher.

References

Please upgrade to `base: core20`

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

base: core18 is now discouraged with all server snaps having moved onto base: core20.

it will give you access to a newer, Ubuntu 20.04 LTS based runtime, and will minimise install size for end-users, as they will no longer need to pull in core18 whenever they want to use powershell.

Expected behavior

$ snap info --verbose powershell | grep base:
base: core20

Actual behavior

$ snap info --verbose powershell | grep base:
base: core18

Error details

No response

Environment data

I am running Ubuntu

Version

latest/stable

Visuals

No response

Not working on Ubuntu 20.04 on WSL2

sudo snap install powershell --classic
sudo snap install powershell-preview --classic

I just installed Ubuntu on WSL2 via the Windows Store and neither of these commands are working:

tig@valdez:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
tig@valdez:~$ do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
tig@valdez:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tig@valdez:~$ sudo snap install powershell --classic
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell: dial unix /run/snapd.socket: connect: no such file or directory
tig@valdez:~$ sudo snap install powershell-preview --classic
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell-preview: dial unix /run/snapd.socket: connect: no such file or directory

What am I missing?

Test and verify snaps on various distros official and community supported

Most Used Distro Stable snap Preview Snap Notes
1 Ubuntu 18.04 Rev 5 Rev 5
2 Ubuntu 16.04 Rev 5 Rev 5
3 Ubuntu 17.10 Rev 5 Rev 5
4 Linux Mint 18.3 Rev 5 Rev 5
5 zorin 12 Rev 3 Rev 3
6 neon 5.13/16.04 Rev 5 Rev 5
7 Linux Mint 19 Rev 5 Rev 5
8 Fedora 28 Rev 5 Rev 5 Stable requires terminal workaround in wrapper, fixed by #9
9 Manjaro Rev 5 Rev 5 Stable requires terminal workaround (not in wrapper yet, fixed by #12)
10 Ubuntu 14.04
11 Ubuntu 18.10 Rev 5 Rev 5 Stable requires terminal workaround (not in wrapper yet, #15 in progress)
12 Debian 9 Rev 3 Rev 3
13 Arch
14 elementary 5
15 Debian Sid
16 Solus 3.9999
17 Linux Mint 18.2
18 Fedora 27
19 kali 2018.2
20 Linux Mint 18.1
21 antergos
22 deepin 15.6
23 Linux Mint 18
24 galliumos 2.1
25 OpenSUSE-leap 15

Please see https://docs.microsoft.com/en-us/powershell/scripting/powershell-core-support?view=powershell-6 for what is actually supported. Other distributions are community supported.

Most Used was based on https://snapcraft.io/vscode on 2018-07-08

If you test this an have any issue, please send ls /etc/*-release and the contents of any of the files so we can detect the distro and implement workarounds for common issues.

`--channel=latest/edge` is outdated vs `stable` for the Preview package.

  1. Prerequisites

    • Write a descriptive title.
    • Make sure you are able to repro it on the latest version
    • Search the existing issues.
  2. Steps to reproduce

    https://snapcraft.io/powershell-preview#:~:text=MIT-,last%20updated,-16%20November%202023 states

    16 November 2023 - latest/stable
    3 May 2023 - latest/edge

  3. Expected behavior

    --channel=latest/edge should always be on the latest version, whether that version is also stable or not.

  4. Actual behavior

    It hasn't been updated since +2023-05-03, whereas --channel=latest/stable was last updated on +2023-11-16.

  5. Error details

    RokeJulianLockhart@s1e8h4:~> snap run powershell-preview
    PowerShell 7.4.0-preview.3
    
    A new PowerShell stable release is available: v7.4.0 
    Upgrade now, or check out the release page at:       
    	https://aka.ms/PowerShell-Release?tag=v7.4.0       
    
    PS /home/RokeJulianLockhart>
    
  6. Environment data

    PS /home/RokeJulianLockhart> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      7.4.0-preview.3
    PSEdition                      Core
    GitCommitId                    7.4.0-preview.3
    OS                             Linux 6.6.3-1-default #1 SMP PREEMPT_DYNAMIC Wed Nov 29 05:06:07 UTC 2023 (d766c57)
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
    PS /home/RokeJulianLockhart>
    
  7. Version

    latest/edge: 7.4.0-preview.3 2023-05-03 (142) 72MB classic

  8. Visuals

    20231209T144440GMT

PowerShell 7 segfaults in ld-2.23.so on Ubuntu 18.04

Steps to reproduce

Update Ubuntu 18.04 system to PowerShell 7. Run pwsh in a bash prompt and it renders a prompt. Simply hitting the enter key and it segfaults every time. Log shows:

VERSION="18.04.4 LTS (Bionic Beaver)"

Mar  4 16:05:07 BernUbun4 powershell[5143]: (7.0.0:1:80) [Perftrack_ConsoleStartupStart:PowershellConsoleStartup.WinStart.Informational] PowerShell console is starting up
Mar  4 16:05:07 BernUbun4 powershell[5143]: (7.0.0:7:80) [NamedPipeIPC_ServerListenerStarted:NamedPipe.Open.Informational] PowerShell has started an IPC listening thread on process: 5143 in AppDomain: None.
Mar  4 16:05:07 BernUbun4 powershell[5143]: (7.0.0:1:80) [Perftrack_ConsoleStartupStop:PowershellConsoleStartup.WinStop.Informational] PowerShell console is ready for user input
Mar  4 16:05:10 BernUbun4 kernel: [ 1846.161529] pwsh[5185]: segfault at 38 ip 00007f134c58275c sp 00007f1291ff9780 error 4 in ld-2.23.so[7f134c576000+26000]

Expected behavior

Do not segfault upon any attempt of interactive use.

Actual behavior

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Linux 4.15.0-88-generic PowerShell/PowerShell#88-Ubuntu SMP Tue Feb …
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Update-Help fails with "Read-only file system"

Output of snap version

snap    2.38+18.10
snapd   2.38+18.10
series  16
ubuntu  18.10
kernel  4.18.0-17-generic

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.0
PSEdition                      Core
GitCommitId                    6.2.0
OS                             Linux 4.18.0-17-generic #18-Ubuntu SMP Wed Mar 13 14:34:40 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Result of running Update-Help

PS /home/joshua> Update-Help -Verbose -Debug
Update-Help : Read-only file system
At line:1 char:1
+ Update-Help -Verbose -Debug
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Update-Help], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.UpdateHelpCommand

Interpreter not being set for the powershell package

repro

install either of these:

snap refresh powershell --channel=edge/FixRelease
snap refresh powershell --channel=lts/edge/FixRelease

then run

powershell

Actual results

Failed to load ���, error: /snap/core18/current/lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
Failed to bind to CoreCLR at '/snap/powershell/119/opt/powershell/'
Failed to create CoreCLR, HRESULT: 0x80008088

Investigation

snap didn't patch the interpreter

patchelf --print-interpreter /snap/powershell/119/opt/powershell/pwsh

should be

/snap/core18/current/lib64/ld-linux-x86-64.so.2

but is

/lib64/ld-linux-x86-64.so.2

Snap Powershell 7 fails to load on openSUSE Tumbleweed with undefined symbol

Steps to reproduce

pwsh

Expected behavior

Loads PowerShell system and displays prompt.

Actual behavior

Failed to load ��e, error: /snap/powershell/104/opt/powershell/../../lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
Failed to bind to CoreCLR at '/snap/powershell/104/opt/powershell/'
Failed to create CoreCLR, HRESULT: 0x80008088

Environment data

Cannot retrieve because PowerShell does not even load in snap form.

uname -a
Linux ost 5.5.7-1-default PowerShell/PowerShell#1 SMP Sun Mar 1 19:28:06 UTC 2020 (1004bce) x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
LSB Version: n/a
Distributor ID: openSUSE
Description: openSUSE Tumbleweed
Release: 20200311
Codename: n/a

I am a lot more familiar and comfortable with Ubuntu 19.10 but decided to try openSUSE Tumbleweed and I installed the Snap system as per instructions at https://snapcraft.io/docs/installing-snap-on-opensuse then I did the "sudo snap install powershell --classic" command like I am used to doing in Ubuntu. Then I run "pwsh" from /snap/bin and get the error. However, the .tar.gz package works fine, for what it's worth. I did something very similar to the instructions here: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#installation---opensuse-leap-15 except I installed everything to my user home folder.

Powershell-Snap doesn't work in WSL2

Is this known issue? Trying to install powershell on Ubuntu 20.04 on WSL2:

whihathac@DESKTOP-5J9MQ2T:~$ sudo snap install powershell--classic
[sudo] password for whihathac:
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell--classic: dial unix /run/snapd.socket: connect: no such file or directory
whihathac@DESKTOP-5J9MQ2T:~$ sudo snap install powershell-preview --classic
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell-preview: dial unix /run/snapd.socket: connect: no such file or directory

Move support messaging to the store and out of wrapper script

Move support messaging to the store and out of wrapper script

see #12 (comment)

I've been thinking, we might want to just put a message on the store page pointing to our support policy and remove these messages about being unsupported. Two reasons:

  • If we want to be accurate, we would need more a whitelist and give the message when we are not on one of those distros, but we would still need the logic for the distros with the terminal issue.
  • Updating the docs is a lot easier than updating the code.

Running pwsh fails, not finding a valid ICU package

Hi,

I have installed PowerShell using snap in Manjaro Linux; here's the output of snap --version:

snap     2.40-1
snapd    2.40-1
series   16
manjaro  -
kernel   5.1.21-1-MANJARO

And my PowerShell version (output of snap list powershell):

Name        Version  Rev  Tracking  Publisher              Notes
powershell  6.2.2    36   stable    microsoft-powershell*  classic

And when I run pwsh, I get this error:

FailFast:
Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.

   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.StringComparer..cctor()
   at System.AppDomain.InitializeCompatibilityFlags()
   at System.AppDomain.Setup(System.Object)
[1]    27195 abort (core dumped)  pwsh

I'm not sure what's happening here because I have package [email protected] installed on Manjaro.

There's a discussion on PowerShell/PowerShell#9522, and also I saw from dotnet/core#2186 that apparently you can configure runtimeOptions for a dotnet app to disable globalization,

I think it would be great if we didn't need to force a configuration to disable globalization, but anyway, even if I want to do it, I don't know where I can configure that option for the snap version of PowerShell.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.