Package Details: snapd 2.51.1-1

Git Clone URL: (read-only, click to copy)
Package Base: snapd
Description: Service and tools for management of snap packages.
Upstream URL:
Licenses: GPL3
Conflicts: snap-confine
Submitter: Barthalion
Maintainer: bboozzoo (zyga)
Last Packager: bboozzoo
Votes: 163
Popularity: 4.70
First Submitted: 2018-01-07 17:37
Last Updated: 2021-06-28 07:58

Pinned Comments

bboozzoo commented on 2018-10-25 11:56

2.36 is the first release with AppArmor enabled by default on Arch.

If you do not have AppArmor enabled at boot there should be no functional changes visible.

If you wish to use snaps with Apparmor, first make sure that Apparmor is enabled during boot, see for details. After upgrading the package, you need to do the following steps:

  • Reload the profiles: systemctl restart apparmor.service
  • Restart snapd: systemctl restart snapd.service
  • Load profiles for snaps: systemctl enable --now snapd.apparmor.service

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 ... Next › Last »

yxgi5 commented on 2021-03-16 08:53

Is there any solution?

make[1]: Leaving directory '/home/andy/.cache/yay/snapd/src/snapd-2.49.1/cmd'
==> Starting check()...
snap-exec is not a static binary
error making: snapd

ArchRob commented on 2021-02-27 22:36

@benalexau the tip about pkgconf helped. I was getting weird errors like:

Traceback (most recent call last):
  File "/usr/bin/rst2man", line 26, in <module>
    publish_cmdline(writer=manpage.Writer(), description=description)
  File "/usr/lib/python3.9/site-packages/docutils/", line 352, in publish_cmdline
    pub.set_components(reader_name, parser_name, writer_name)
  File "/usr/lib/python3.9/site-packages/docutils/", line 94, in set_component

I ran sudo pacman -S pkgconf. It was already installed, and pacman confirmed it was simply reinstalling. But after that, I was able to build this package without issue. No idea why, but it worked.

bboozzoo commented on 2021-02-27 18:42

@rageltman looks like the Go compiler crashed in your system. Maybe try buliding a minimal hello world, you can find an example here: Perhaps you should also file a bug for the golang package.

rageltman commented on 2021-02-27 15:57

Not quite sure what to make of this one:

[2021-02-27T05:38:01.052Z] ==> Starting build()...
[2021-02-27T05:38:01.052Z] fatal: not a git repository (or any of the parent directories): .git
[2021-02-27T05:38:01.052Z] fatal: not a git repository (or any of the parent directories): .git
[2021-02-27T05:38:01.052Z] *** Setting version to '2.49-1' from user.
[2021-02-27T05:38:01.052Z] # net
[2021-02-27T05:38:01.052Z] cgo: cannot load DWARF output from $WORK/b058//_cgo_.o: decoding dwarf section info at offset 0x0: too short
[2021-02-27T05:38:01.052Z] # os/user
[2021-02-27T05:38:01.052Z] cgo: cannot load DWARF output from $WORK/b064//_cgo_.o: decoding dwarf section info at offset 0x0: too short
[2021-02-27T05:38:01.052Z] ==> ERROR: A failure occurred in build().
[2021-02-27T05:38:01.052Z]     Aborting...
script returned exit code 255

cindrmon commented on 2021-02-14 10:49

@bboozzoo thanks for the tip! it worked when i switched back to bash. i guess it is because i was using fish, no wonder it wouldn't work. thanks again!

bboozzoo commented on 2021-02-14 09:42

@cindrmon /etc/profile.d/ is only sourced by bash and zsh. There's a systemd mechanism that injects the right variables into your session via /usr/lib/environment.d/990-snapd.conf which should also work if you use other shells. It's possible that your desktop environment can mess something up too, IIRC lxde did that. Lastly, the profile scripts in your $HOME can override PATH by mistake. I suggest you add a new account, log into that and check whether PATH includes snap locations.

cindrmon commented on 2021-02-14 05:15

i have a inquiry

why does the /etc/profile.d/ don't work?

i've been restarting my pc over and over again after installing this specific package and there is still no snap in the $PATH variable.

i even tried executing the script itself, and it still doesn't work.

can anyone help?

bboozzoo commented on 2021-01-28 06:36

@benalexau the base-devel group is an implicit requirement for all AUR packages, pkgconf (which provides pkg-config) is already included in that group. Please make sure that it is installed in your system before building any AUR packages.

benalexau commented on 2021-01-28 00:53


==> Starting build()...
*** Setting version to '2.48.2-1' from user.
# pkg-config --cflags  -- libseccomp libseccomp
pkg-config: exec: "pkg-config": executable file not found in $PATH
==> ERROR: A failure occurred in build().

Solved by installing pkgconf. Please add pkgconf to makedepends.

Anonymous comment on 2020-12-16 17:29

New update from upstream with check sum:

# Maintainer: aimileus <me at aimileus dot nl>
# Maintainer: Maciej Borzecki <>
# Contributor: Timothy Redaelli <>
# Contributor: Zygmunt Krynicki <me at zygoon dot pl>

pkgdesc="Service and tools for management of snap packages."
depends=('squashfs-tools' 'libseccomp' 'libsystemd' 'apparmor')
optdepends=('bash-completion: bash completion support'
            'xdg-desktop-portal: desktop integration')
arch=('x86_64' 'i686' 'armv7h' 'aarch64')
makedepends=('git' 'go' 'go-tools' 'libseccomp' 'libcap' 'systemd' 'xfsprogs' 'python-docutils' 'apparmor')
options=('!strip' 'emptydirs')

prepare() {
  cd "$pkgname-$pkgver"

  export GOPATH="$srcdir/go"
  mkdir -p "$GOPATH"

  # Have snapd checkout appear in a place suitable for subsequent GOPATH. This
  # way we don't have to go get it again and it is exactly what the tag/hash
  # above describes.
  mkdir -p "$(dirname "$GOPATH/src/${_gourl}")"
  ln --no-target-directory -fs "$srcdir/$pkgname-$pkgver" "$GOPATH/src/${_gourl}"

  for name in "${source[@]}"; do
      if [[ "${name%.patch}" == "$name" ]]; then
          # not a patch
      msg2 "applying $name"
      patch -p1 -i "$srcdir/$name"

build() {
  cd "$pkgname-$pkgver"
  export GOPATH="$srcdir/go"

  # GOFLAGS may be modified by CI tools
  # GOFLAGS are the go build flags for all binaries, GOFLAGS_SNAP are for snap
  # build only.
  GOFLAGS_SNAP="-tags nomanagers"
  # snapd does not support modules yet, explicitly disable Go modules
  export GO111MODULE=off

  export CGO_ENABLED="1"
  export CGO_CFLAGS="${CFLAGS}"

  ./ $pkgver-$pkgrel

  # because argument expansion with quoting in bash is hard, and -ldflags=-extldflags='-foo'
  # is not exactly the same as -ldflags "-extldflags '-foo'" use the array trick
  # to pass exactly what we want
  flags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '$LDFLAGS'" -trimpath)
  staticflags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '$LDFLAGS -static'" -trimpath)
  # Build/install snap and snapd
  go build "${flags[@]}" -o "$srcdir/go/bin/snap" $GOFLAGS_SNAP "${_gourl}/cmd/snap"
  go build "${flags[@]}" -o "$srcdir/go/bin/snapd" $GOFLAGS "${_gourl}/cmd/snapd"
  go build "${flags[@]}" -o "$srcdir/go/bin/snap-seccomp" $GOFLAGS "${_gourl}/cmd/snap-seccomp"
  go build "${flags[@]}" -o "$srcdir/go/bin/snap-failure" $GOFLAGS "${_gourl}/cmd/snap-failure"
  # build snap-exec and snap-update-ns completely static for base snaps
  go build "${staticflags[@]}" -o "$srcdir/go/bin/snap-update-ns" $GOFLAGS "${_gourl}/cmd/snap-update-ns"
  go build "${staticflags[@]}" -o "$srcdir/go/bin/snap-exec" $GOFLAGS "${_gourl}/cmd/snap-exec"
  go build "${staticflags[@]}" -o "$srcdir/go/bin/snapctl" $GOFLAGS "${_gourl}/cmd/snapctl"

  # Generate data files such as real systemd units, dbus service, environment
  # setup helpers out of the available templates
  make -C data \
       BINDIR=/bin \
       LIBEXECDIR=/usr/lib \
       SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system \
       SNAP_MOUNT_DIR=/var/lib/snapd/snap \

  cd cmd
  autoreconf -i -f
  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib/snapd \
    --with-snap-mount-dir=/var/lib/snapd/snap \
    --enable-apparmor \
    --enable-nvidia-biarch \

check() {
    export GOPATH="$srcdir/go"
    cd "$srcdir/go/src/${_gourl}"

    # make sure the binaries that need to be built statically really are
    for binary in snap-exec snap-update-ns snapctl; do
        LC_ALL=C ldd "$srcdir/go/bin/$binary" 2>&1 | grep -q 'not a dynamic executable'

package() {
  cd "$pkgname-$pkgver"
  export GOPATH="$srcdir/go"
  # snapd does not use modules, setting GO111MODULE=on in the environment breaks
  # the build
  unset GO111MODULE

  # Install bash completion
  install -Dm644 data/completion/bash/snap \
  install -Dm644 data/completion/bash/ \
  install -Dm644 data/completion/bash/ \
  # Install zsh completion
  install -Dm644 data/completion/zsh/_snap \

  # Install systemd units, dbus services and a script for environment variables
  make -C data/ install \
     DBUSSERVICESDIR=/usr/share/dbus-1/services \
     BINDIR=/usr/bin \
     SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system \
     SNAP_MOUNT_DIR=/var/lib/snapd/snap \
  # no tweaks for sudo are needed
  rm -rfv "$pkgdir/etc/sudoers.d"

  # Install polkit policy
  install -Dm644 data/polkit/io.snapcraft.snapd.policy \

  # Install executables
  install -Dm755 "$srcdir/go/bin/snap" "$pkgdir/usr/bin/snap"
  install -Dm755 "$srcdir/go/bin/snapctl" "$pkgdir/usr/lib/snapd/snapctl"
  install -Dm755 "$srcdir/go/bin/snapd" "$pkgdir/usr/lib/snapd/snapd"
  install -Dm755 "$srcdir/go/bin/snap-seccomp" "$pkgdir/usr/lib/snapd/snap-seccomp"
  install -Dm755 "$srcdir/go/bin/snap-failure" "$pkgdir/usr/lib/snapd/snap-failure"
  install -Dm755 "$srcdir/go/bin/snap-update-ns" "$pkgdir/usr/lib/snapd/snap-update-ns"
  install -Dm755 "$srcdir/go/bin/snap-exec" "$pkgdir/usr/lib/snapd/snap-exec"
  # Ensure /usr/bin/snapctl is a symlink to /usr/libexec/snapd/snapctl
  ln -s /usr/lib/snapd/snapctl "$pkgdir/usr/bin/snapctl"

  # pre-create directories
  install -dm755 "$pkgdir/var/lib/snapd/snap"
  install -dm755 "$pkgdir/var/cache/snapd"
  install -dm755 "$pkgdir/var/lib/snapd/apparmor"
  install -dm755 "$pkgdir/var/lib/snapd/assertions"
  install -dm755 "$pkgdir/var/lib/snapd/dbus-1/services"
  install -dm755 "$pkgdir/var/lib/snapd/dbus-1/system-services"
  install -dm755 "$pkgdir/var/lib/snapd/desktop/applications"
  install -dm755 "$pkgdir/var/lib/snapd/device"
  install -dm755 "$pkgdir/var/lib/snapd/hostfs"
  install -dm755 "$pkgdir/var/lib/snapd/mount"
  install -dm755 "$pkgdir/var/lib/snapd/seccomp/bpf"
  install -dm755 "$pkgdir/var/lib/snapd/snap/bin"
  install -dm755 "$pkgdir/var/lib/snapd/snaps"
  install -dm755 "$pkgdir/var/lib/snapd/inhibit"
  install -dm755 "$pkgdir/var/lib/snapd/lib/gl"
  install -dm755 "$pkgdir/var/lib/snapd/lib/gl32"
  install -dm755 "$pkgdir/var/lib/snapd/lib/vulkan"
  install -dm755 "$pkgdir/var/lib/snapd/lib/glvnd"
  # these dirs have special permissions
  install -dm111 "$pkgdir/var/lib/snapd/void"
  install -dm700 "$pkgdir/var/lib/snapd/cookie"
  install -dm700 "$pkgdir/var/lib/snapd/cache"

  make -C cmd install DESTDIR="$pkgdir/"

  # Install man file
  mkdir -p "$pkgdir/usr/share/man/man8"
  "$srcdir/go/bin/snap" help --man > "$pkgdir/usr/share/man/man8/snap.8"

  # Install the "info" data file with snapd version
  install -m 644 -D "$srcdir/go/src/${_gourl}/data/info" \

  # Remove snappy core specific units
  rm -fv "$pkgdir/usr/lib/systemd/system/snapd.system-shutdown.service"
  rm -fv "$pkgdir/usr/lib/systemd/system/snapd.autoimport.service"
  rm -fv "$pkgdir/usr/lib/systemd/system/snapd.recovery-chooser-trigger.service"
  rm -fv "$pkgdir"/usr/lib/systemd/system/snapd.snap-repair.*
  rm -fv "$pkgdir"/usr/lib/systemd/system/snapd.core-fixup.*
  # and scripts
  rm -fv "$pkgdir/usr/lib/snapd/"
  rm -fv "$pkgdir/usr/bin/ubuntu-core-launcher"
  rm -fv "$pkgdir/usr/lib/snapd/system-shutdown"