16

I am trying to install heroku cli using

sudo snap install heroku --classic

The command line says

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

I tried systemctl status snapd.service this is the result :

snapd.service
   Loaded: masked (/dev/null; bad)  
   Active: inactive (dead)

I tried systemctl restart snapd.service it says:

Failed to restart snapd.service: Unit snapd.service is masked.

Any help on above problem in appreciated. Thanks.

1
17

Unmask the snapd.service:

sudo systemctl unmask snapd.service

Enable it:

sudo systemctl enable snapd.service

Start it:

sudo systemctl start snapd.service

Then try installing your desired app.

3
  • 1
    I am running WSL based on Ubuntu Linux, And running these instructions gives error after last command: System has not been booted with systemd as init system (PID 1). Can't operate.
    – Andy
    Aug 17 at 14:55
  • 2
    If you are using WSL then this answer is not applicable to your situation. Basically because there is no systemd on WSL in the first place. However this might be helpful to you.
    – Ravexina
    Aug 17 at 16:31
  • 1
    I am inside a docker image of ubuntu. Running systemctl start snapd.service returns System has not been booted with systemd as init system (PID 1). Can't operate.
    – Jortega
    Sep 13 at 23:00

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