Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

snap and gitlab-CI: error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world

If I try to run snap under a gitlab-CI pipeline, installing the most simple package, it fails with:

$ snap install hello-world

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

The gitlab-ci yml configuration file is the simplest ever:

image: ubuntu:18.04

before_script:
  - apt-get update -qq

test:
  script:
    - apt-get install -y snapd
    - snap version
    - snap install hello-world
    - hello-world

What's going on?

like image 851
knocte Avatar asked Apr 23 '19 04:04

knocte


People also ask

What is a snap in Ubuntu?

A snap is a bundle of an app and its dependencies that works without modification across many different Linux distributions. Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions. Snapcraft is a powerful and easy to use command line tool for building snaps.

How do I download snap on Linux?

To install snap from the Software Manager application, search for snapd and click Install. Either restart your machine, or log out and in again, to complete the installation.

How do you run a snap program?

The snap terminal command, however, is the primary interface to all of snap's packaging features. It's easily run by first opening a terminal and typing snap followed by a command. Typing snap on its own will show some brief help text and list of example commands to try, including the find command.


1 Answers

In my case it is solved by starting the snapd service:

systemctl start snapd.service
like image 67
Mohammed Shabeer k Avatar answered Sep 20 '22 13:09

Mohammed Shabeer k