If EPEL is enabled in your system, you may need to be a bit more specific when installing snapd, so instead of
$ yum install snapd
you may need to run
$ yum install snapd-2.47.1-1.amzn2.1
The package is based on the EPEL one, with the main difference that SELinux is disabled (since it’s not supported by AMZN2 kernel anyway), and /snap -> /var/lib/snapd/snap symlink is avaialble out of the box.
We want to make the repository a bit more official and eventually host it at snapcraft.io.
You can also add this at the inside the /etc/yum.conf file to disable snapd packages from EPEL:
Thanks for your prompt response! Will certainly try out the new release. That being said, hopefully the whole process can be fully automated in near future? To put this to production use the timely availability of update is critical.
Hey @mborzecki, thanks for the work but unfortunately I cannot install snapd like in your instructions. I tried yum install snapd-2.47.1-1.amzn2.1 but got No package snapd-2.47.1-1.amzn2.1 available
I then tried to find the newest version at https://people.canonical.com/~mvo/snapd/amazon-linux2/repo/sources/packages/ and tried to install $ sudo yum install snapd-2.51-1.amzn2.1 but same result. I am using Amazon Linux 2 with centos rhel fedora. Could you help me sort out this issue? I would be very grateful Thanks already!
Checked on my AMZN2 system, things seem to work ok:
google:amazon-linux-2-64 /# yum repolist
Loaded plugins: langpacks, priorities, update-motd
216 packages excluded due to repository priority protections
repo id repo name status
amzn2-core/2/x86_64 Amazon Linux 2 core repository 25526
amzn2extra-epel/2/x86_64 Amazon Extras repo for epel 1
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13403+216
snapd-amzn2/x86_64 snapd packages for Amazon Linux 2 4
repolist: 38934
You need to add the snapd repository which is linked at the very top. The version of snapd from EPEL is built against RHEL repositories, but AMZN2 repositories are outdated and thus the package cannot be installed.
Just cd /etc/yum.repos.d && wget https://people.canonical.com/~mvo/snapd/amazon-linux2/snapd-amzn2.repo.
Can you please improve on the systemd service by adding
EnvironmentFile=-/etc/environment
I have to manually add them back each time after the rpm updated as my servers are behind a proxy.
Or should a request be logged on the snapd github?
The packages use /etc/sysconfig/snapd which is what is expected of any package coming from Fedora/EPEL. The packages provided in the repository are a rebuild of what is available in EPEL, but with SELinux disabled (as Amazon’s own repositories provide outdated versions of selinux policy). I intend to keep them as close as possible to what is in EPEL.
As an admin you can drop a *.conf override file in /etc/systemd/system/snapd.service.d/ directory with the following content:
[Service]
Environment=-/etc/environment
Which also means you don’t have to edit anything after updating the packages.