Cannot install snapd on Amazon Linux 2

Thank you @Lin-Buo-Ren & @mborzecki for your assistance. I was afraid the server was not actually a CentOS system.

I am trying to build the RPM from source but have some questions as I have never done this before:

1. Running rpmbuild -bs snapd.spec requires that I have 2 files in SOURCES:

  • snapd_2.47.1.no-vendor.tar.xz
  • snapd_2.47.1.only-vendor.tar.xz

The tarball from the repository link is named otherwise, so I copied it twice and renamed it. This is likely incorrect because…

2. After it builds I see the following output:

systemd_post: invalid option -- '-'
error: Unknown option - in systemd_post()
Wrote: /root/rpmbuild/SRPMS/snapd-2.47.1-0.amzn2.src.rpm

3. I then ran rpmlint to check the integrity of the binary and received:

> rpmlint snapd-2.47.1-0.amzn2.src.rpm 

snapd.src: W: no-version-in-last-changelog
snapd.src:87: E: hardcoded-library-path in %{_prefix}/lib/environment.d}
snapd.src:88: E: hardcoded-library-path in %{_prefix}/lib/systemd/system-generators}
snapd.src:89: E: hardcoded-library-path in %{_prefix}/lib/systemd/system-environment-generators}
snapd.src:279: W: unversioned-explicit-provides bundled(golang(github.com/snapcore/bolt))
snapd.src:280: W: unversioned-explicit-provides bundled(golang(github.com/coreos/go-systemd/activation))
snapd.src:281: W: unversioned-explicit-provides bundled(golang(github.com/godbus/dbus))
snapd.src:282: W: unversioned-explicit-provides bundled(golang(github.com/godbus/dbus/introspect))
snapd.src:283: W: unversioned-explicit-provides bundled(golang(github.com/gorilla/mux))
snapd.src:284: W: unversioned-explicit-provides bundled(golang(github.com/jessevdk/go-flags))
snapd.src:285: W: unversioned-explicit-provides bundled(golang(github.com/juju/ratelimit))
snapd.src:286: W: unversioned-explicit-provides bundled(golang(github.com/kr/pretty))
snapd.src:287: W: unversioned-explicit-provides bundled(golang(github.com/kr/text))
snapd.src:288: W: unversioned-explicit-provides bundled(golang(github.com/mvo5/goconfigparser))
snapd.src:289: W: unversioned-explicit-provides bundled(golang(github.com/mvo5/libseccomp-golang))
snapd.src:290: W: unversioned-explicit-provides bundled(golang(github.com/snapcore/go-gettext))
snapd.src:291: W: unversioned-explicit-provides bundled(golang(golang.org/x/crypto/openpgp/armor))
snapd.src:292: W: unversioned-explicit-provides bundled(golang(golang.org/x/crypto/openpgp/packet))
snapd.src:293: W: unversioned-explicit-provides bundled(golang(golang.org/x/crypto/sha3))
snapd.src:294: W: unversioned-explicit-provides bundled(golang(golang.org/x/crypto/ssh/terminal))
snapd.src:295: W: unversioned-explicit-provides bundled(golang(golang.org/x/xerrors))
snapd.src:296: W: unversioned-explicit-provides bundled(golang(golang.org/x/xerrors/internal))
snapd.src:297: W: unversioned-explicit-provides bundled(golang(gopkg.in/check.v1))
snapd.src:298: W: unversioned-explicit-provides bundled(golang(gopkg.in/macaroon.v1))
snapd.src:299: W: unversioned-explicit-provides bundled(golang(gopkg.in/mgo.v2/bson))
snapd.src:300: W: unversioned-explicit-provides bundled(golang(gopkg.in/retry.v1))
snapd.src:301: W: unversioned-explicit-provides bundled(golang(gopkg.in/tomb.v2))
snapd.src:302: W: unversioned-explicit-provides bundled(golang(gopkg.in/yaml.v2))
snapd.src:3324: W: macro-in-%changelog %systemd_user_
snapd.src: E: specfile-error systemd_post: invalid option -- '-'
snapd.src: E: specfile-error error: Unknown option - in systemd_post()
1 packages and 0 specfiles checked; 5 errors, 26 warnings.

I assume the warnings are probably ok; but there are some errors as well. I haven’t gone further than this yet as I am not quite sure if I should try to install this RPM given the errors mentioned.

Many thanks in advance for any help you can provide.