0

I am following the instructions here to install VSCode, but I get an error on the very first line. It is written at snapcraft that "If you’re running Ubuntu 16.04 LTS (Xenial Xerus) or later, including Ubuntu 18.04 LTS (Bionic Beaver), Ubuntu 18.10 (Cosmic Cuttlefish) and Ubuntu 19.10 (Eoan Ermine), you don’t need to do anything. Snap is already installed and ready to go."

error: cannot communicate with server: Post http://localhost/v2/snaps/code: dial unix /run/snapd.socket: connect: no such file or directory

When I try to ping snap with the command "systemctl status snapd.service", I get

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

When I try to check the snap version with "snap version", nothing happens. In fact, that was a lie, for the result is even worse than nothing happening. Ubuntu moves onto the next line, you cannot type any more commands, and I have to press ctrl-C to get out of a silent but deadly infinite loop.

Every time I try to install a line editor, it fails. I couldn't get gedit to work and I couldn't get emacs to work. Ubuntu is quickly becoming a pain to work with, and I'd appreciate if someone could tell me where I'm going wrong in trying to install VSCode.

OS: Windows 10

Ubuntu version: 20.04.1

2
  • You cannot install Snap packages in WSL. You must use a different Virtual Machine host application like VirtualBox or VMWare. – user535733 Jan 31 at 2:52
  • @user535733 It turns out the solution was even simpler than VirtualBox or VMWare, but I didn't notice until you said it was impossible to use snap. After searching VS Code WSL, I found code.visualstudio.com/docs/remote/wsl and followed the instructions. – Display name Jan 31 at 3:51
0

You cannot use snap in WSL. Follow the instructions here to install VS Code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.