Fix Snap on WSL2
Fix Snap on WSL2
- Enable systemd on WSL2 by running the following commands:cd ~git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.gitcd ubuntu-wsl2-systemd-script/bash ubuntu-wsl2-systemd-script.sh# Enter your password and wait until the script has finished
- Restart WSL2 by opening a new PowerShell session and run
wsl --shutdown
. - Open a new WSL2 shell and run:systemctl --version
- Your should find a version number
systemd 237
or a newer version of systemd. - Unmask the snapd.service and restart it with the following command:sudo systemctl unmask snapd.servicesudo systemctl enable snapd.servicesudo systemctl start snapd.service
- Now you can use Snap command on WSL2.
Loading comments...