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?
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.
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.
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.
In my case it is solved by starting the snapd
service:
systemctl start snapd.service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With