Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Setting up Heroku CLI in WSL

Writer Olivia Zamora

Trying to setup Heroku CLI to work with WSL.

Starting by following the directions here for Ubuntu 16+:

sudo snap install --classic heroku

Produces the following error:

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

Googled the error and came across this thread:

I tried systemctl status snapd.service, which just says the following:

System has not been booted with systemd as init system (PID 1). Can't operate.

Restart WSL and the computer and same issue.

Thought maybe snapd wasn't installed because typing snap or snapd says Command '____' not found, did you mean:.... But trying to do sudo apt-get install snapd says that it is already the latest version.

3 Answers

Nope, doesn't sound like there is current support in WSL for snap. snapd, nor systemd. Thankfully there is a manual install provided by Heroku, so will give that a shot.

This worked in my case:

curl | sh

6

It's not a great solution, and requires context switching, but you can install the Heroku cli in Windows and do your pushes/Heroku cli interactions from the Windows interface.

voted answer did work but first had to do the following

first enable virtual machine platform

enter image description here

then had to update default version for wsl by running the following in ps (for me was in ps 7)

wsl --set-default-version 2

then i was able to run the following in ubuntu bash

curl | sh

and all works so far

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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