Hello. I’d like to install Certbot on Amazon Linux EC2 instance. The documentation recommends using Snap. I am getting errors when trying to install any snap.
Here are the articles I’ve already gone through:
- Configure SSL/TLS on Amazon Linux 2 - Amazon Elastic Compute Cloud
- Get Certbot — Certbot 2.6.0 documentation (eff-certbot.readthedocs.io)
Along with the following (I was only allowed to put 2 links in this post, so I had to preformat them)
https://github.com/albuild/snap (Followed Install for Amazon WorkSpaces instructions)
https://forum.snapcraft.io/t/cannot-install-snapd-on-amazon-linux-2/20824
https://forum.snapcraft.io/t/cannot-install-snap-file-snap-is-unusable-due-to-missing-files/25719 (I am unable to downgrade squashfs-tools)
https://forum.snapcraft.io/t/unofficial-snapd-repository-for-amazon-linux-2/24269 (The unofficial repository is no longer accessible)
$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-15"
$ cat /etc/amazon-linux-release
Amazon Linux release 2023 (Amazon Linux)
$ cat /proc/version
Linux version 6.1.72-96.166.amzn2023.x86_64 (mockbuild@ip-10-0-50-38) (gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2), GNU ld version 2.39-6.amzn2023.0.10) #1 SMP PREEMPT_DYNAMIC Wed Jan 17 00:42:52 UTC 2024
All of the following commands ran without issue
$ sudo mkdir /opt/albuild
$ sudo mkdir /opt/albuild/snap
$ cd /opt/albuild/snap/
$ sudo wget https://github.com/albuild/snap/releases/download/v0.1.0/snap-confine-2.36.3-0.amzn2.x86_64.rpm
$ sudo wget https://github.com/albuild/snap/releases/download/v0.1.0/snapd-2.36.3-0.amzn2.x86_64.rpm
$ sudo yum -y install /opt/albuild/snap/snap-confine-2.36.3-0.amzn2.x86_64.rpm /opt/albuild/snap/snapd-2.36.3-0.amzn2.x86_64.rpm
$ sudo systemctl enable --now snapd.socket
$ sudo ln -s /var/lib/snapd/snap /snap
$ sudo reboot
$ snap --version
snap 2.36.3-0.amzn2
snapd 2.36.3-0.amzn2
series 16
amzn 2023
kernel 6.1.72-96.166.amzn2023.x86_64
But I receive the following error when I try to install anything with snap
$ sudo snap install --classic hello-world
error: cannot perform the following tasks:
- Mount snap "core" (16202) (snap is unusable due to missing files; contact developer)
$ sudo snap install --classic certbot
error: cannot perform the following tasks:
- Mount snap "core20" (2105) (snap is unusable due to missing files; contact developer)
This is the result when I tried to downgrade squashfs
$ sudo yum downgrade squashfs-tools
Last metadata expiration check: 4:33:27 ago on Fri Jan 26 13:47:07 2024.
Package squashfs-tools of lowest version already installed, cannot downgrade it.
Dependencies resolved.
Nothing to do.
Complete!
Any help would be appreciated.
Thank you!