lucyllewy / one-script-wsl2-systemd

The one-script variant of the systemd hack for WSL2
MIT License
231 stars 38 forks source link

snap path not working after restart #14

Closed rlnt closed 3 months ago

rlnt commented 2 years ago

First of all, thanks for this awesome script. It was really easy and works pretty well.

I installed GitKraken and IntelliJ IDEA Ultimate with snap on my WSL 2 system. I am running Ubuntu 20.04. I am pretty sure that I was able to run gitkraken in my terminal just fine when I installed it but after a restart, this is no longer possible. I wasn't able to start IntelliJ at all. It's possible to start both snaps with snap run <name> and I can also start them on my Windows 11 system because I copied the desktop files from /var/lib/snapd/desktop/applications to /usr/share/applications.

When executing sudoedit /etc/environment, I get the following output:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
WSL_INTEROP='/run/WSL/1300_interop'
WSL_DISTRO_NAME=''
DISPLAY=':0'

The snap path is included but snaps are not found as commands.

❯ gitkraken
zsh: command not found: gitkraken

Using echo $PATH gives me a list of the whole Windows path as well.

lucyllewy commented 2 years ago

Hi, sorry I missed this for so long. Is this still an issue if you redownload the install.ps1 script and rerun it to update your installation to the latest implementation? (A lot has changed in the code over the past year so I'd like to confirm that it is still a problem with the current version)