I have a Nextjs application which I successfully deployed on Amazon Ec2 instance. I configured my DNS to point to the IP. Now I want to install ssl certificate using certbot in the instance.
I used this guide from certbot webiste itself.
But I am stuck at install snapd to proceed with the guide. While installing snapd using the command
sudo yum install snapd
, it shows the dependency error below:
[ec2-user@ip-172-31-21-133 collaboratorDashboard]$ sudo yum install snapd
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
236 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package snapd.x86_64 0:2.55.3-1.el7 will be installed
--> Processing Dependency: snap-confine(x86-64) = 2.55.3-1.el7 for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: snapd-selinux = 2.55.3-1.el7 for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: fuse for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: squashfs-tools for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: squashfuse for package: snapd-2.55.3-1.el7.x86_64
--> Running transaction check
---> Package fuse.x86_64 0:2.9.2-11.amzn2 will be installed
---> Package snap-confine.x86_64 0:2.55.3-1.el7 will be installed
---> Package snapd-selinux.noarch 0:2.55.3-1.el7 will be installed
--> Processing Dependency: selinux-policy >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
--> Processing Dependency: policycoreutils-python for package: snapd-selinux-2.55.3-1.el7.noarch
---> Package squashfs-tools.x86_64 0:4.3-0.21.gitaae0aff4.amzn2.0.1 will be installed
--> Processing Dependency: liblzo2.so.2()(64bit) for package: squashfs-tools-4.3-0.21.gitaae0aff4.amzn2.0.1.x86_64
---> Package squashfuse.x86_64 0:0.1.102-1.el7 will be installed
--> Processing Dependency: squashfuse-libs(x86-64) = 0.1.102-1.el7 for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuseprivate.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libsquashfuse.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libzstd.so.1()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Running transaction check
---> Package libzstd.x86_64 0:1.5.2-1.amzn2 will be installed
---> Package lzo.x86_64 0:2.06-8.amzn2.0.4 will be installed
---> Package policycoreutils-python.x86_64 0:2.5-22.amzn2 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-2 for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-9 for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-22.amzn2.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-22.amzn2.x86_64
---> Package snapd-selinux.noarch 0:2.55.3-1.el7 will be installed
--> Processing Dependency: selinux-policy >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
---> Package squashfuse-libs.x86_64 0:0.1.102-1.el7 will be installed
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.1-3.amzn2.1 will be installed
---> Package checkpolicy.x86_64 0:2.5-6.amzn2 will be installed
---> Package libcgroup.x86_64 0:0.41-21.amzn2 will be installed
---> Package libselinux-python.x86_64 0:2.5-12.amzn2.0.2 will be installed
---> Package libsemanage-python.x86_64 0:2.5-11.amzn2 will be installed
---> Package python-IPy.noarch 0:0.75-6.amzn2.0.1 will be installed
---> Package setools-libs.x86_64 0:3.3.8-2.amzn2.0.2 will be installed
---> Package snapd-selinux.noarch 0:2.55.3-1.el7 will be installed
--> Processing Dependency: selinux-policy >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7_9.2 for package: snapd-selinux-2.55.3-1.el7.noarch
--> Finished Dependency Resolution
Error: Package: snapd-selinux-2.55.3-1.el7.noarch (epel)
Requires: selinux-policy-base >= 3.13.1-268.el7_9.2
Installed: selinux-policy-targeted-3.13.1-192.amzn2.6.8.noarch (installed)
selinux-policy-base = 3.13.1-192.amzn2.6.8
Available: selinux-policy-minimum-3.13.1-166.amzn2.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.5
Available: selinux-policy-minimum-3.13.1-166.amzn2.9.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.9
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.1.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.1
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.2.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.2
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.3.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.3
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.5
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.7.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.7
Available: selinux-policy-minimum-3.13.1-192.amzn2.6.8.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.8
Available: selinux-policy-mls-3.13.1-166.amzn2.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.5
Available: selinux-policy-mls-3.13.1-166.amzn2.9.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.9
Available: selinux-policy-mls-3.13.1-192.amzn2.6.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6
Available: selinux-policy-mls-3.13.1-192.amzn2.6.1.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.1
Available: selinux-policy-mls-3.13.1-192.amzn2.6.2.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.2
Available: selinux-policy-mls-3.13.1-192.amzn2.6.3.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.3
Available: selinux-policy-mls-3.13.1-192.amzn2.6.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.5
Available: selinux-policy-mls-3.13.1-192.amzn2.6.7.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.7
Available: selinux-policy-mls-3.13.1-192.amzn2.6.8.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.8
Available: selinux-policy-targeted-3.13.1-166.amzn2.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.5
Available: selinux-policy-targeted-3.13.1-166.amzn2.9.noarch (amzn2-core)
selinux-policy-base = 3.13.1-166.amzn2.9
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.1.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.1
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.2.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.2
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.3.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.3
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.5.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.5
Available: selinux-policy-targeted-3.13.1-192.amzn2.6.7.noarch (amzn2-core)
selinux-policy-base = 3.13.1-192.amzn2.6.7
Error: Package: snapd-selinux-2.55.3-1.el7.noarch (epel)
Requires: selinux-policy >= 3.13.1-268.el7_9.2
Installed: selinux-policy-3.13.1-192.amzn2.6.8.noarch (installed)
selinux-policy = 3.13.1-192.amzn2.6.8
Available: selinux-policy-3.13.1-166.amzn2.5.noarch (amzn2-core)
selinux-policy = 3.13.1-166.amzn2.5
Available: selinux-policy-3.13.1-166.amzn2.9.noarch (amzn2-core)
selinux-policy = 3.13.1-166.amzn2.9
Available: selinux-policy-3.13.1-192.amzn2.6.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6
Available: selinux-policy-3.13.1-192.amzn2.6.1.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6.1
Available: selinux-policy-3.13.1-192.amzn2.6.2.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6.2
Available: selinux-policy-3.13.1-192.amzn2.6.3.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6.3
Available: selinux-policy-3.13.1-192.amzn2.6.5.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6.5
Available: selinux-policy-3.13.1-192.amzn2.6.7.noarch (amzn2-core)
selinux-policy = 3.13.1-192.amzn2.6.7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I have already tried resolving the issue using this answer by removing selinux-policy-base and reinstalling it but the reinstallation raises more dependency issues.
I also enable Continues release as mentioned in the certbot website but that doesn't change anything
Here's my os-release information:
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Snap is not the only way to install Certbot but it's just the preferred one.
I "solved" this problem by installing Certbot with Pip.
From the official Certbot documentation:
sudo dnf install python3 augeas-libs
sudo python3 -m venv /opt/certbot/ && sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
There you go
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