Error: cannot install "certbot": classic confinement requires snaps under /snap

My domain is: https://harshrathod.dev

I ran this command: snap install --classic certbot

It produced this output:

[root@localhost ~]# snap install --classic certbot
error: cannot install "certbot": classic confinement requires snaps under /snap
       or symlink from /snap to /var/lib/snapd/snap

My web server is (include version):nginx 1.18

The operating system my web server runs on is (include version):Fedora 33

My hosting provider, if applicable, is:MilesWeb

I can login to a root shell on my machine (yes or no, or I don't know):yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

1 Like

Note: I don't have any experience with snap at all..

In the certbot instructions it said:

sudo snap install core; sudo snap refresh core

I assume you did that? Can you confirm that?

Also, I found the following:

https://snapcraft.io/docs/installing-snap-on-fedora

It says:

To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap :

$ sudo ln -s /var/lib/snapd/snap /snap

Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.

Could you try that and afterwards try to install certbot again?

6 Likes

I restarted the VPS and also did this. Nothing happens.

[root@localhost ~]# ln -s /var/lib/snapd/snap /snap
[root@localhost ~]# snap install --classic certbot
error: cannot install "certbot": classic confinement requires snaps under /snap
       or symlink from /snap to /var/lib/snapd/snap
1 Like

That's strange.

Here is my output on a fresh Fedora 33 server:

[root@guest ~]# cat /etc/fedora-release
Fedora release 33 (Thirty Three)
[root@guest ~]# snap install --classic certbot
error: cannot install "certbot": classic confinement requires snaps under /snap or symlink from
      /snap to /var/lib/snapd/snap
[root@guest ~]# ln -s /var/lib/snapd/snap /snap
[root@guest ~]#
[root@guest ~]# snap install --classic certbot
2020-11-08T08:54:00Z INFO Waiting for automatic snapd restart...
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session
        since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
        for more details.

certbot 1.9.0 from Certbot Project (certbot-eff✓) installed

After creating the classic symlink (per https://snapcraft.io/docs/installing-snap-on-fedora) I was immediately able to install Certbot.

5 Likes
  1. Removed the snapd: dnf remove snapd
  2. Restarted the VPS.
  3. Installed snapd again: dnf install snapd
  4. Installed core: snap install core
  5. Got a warning asking for restarting the system. So restarted the VPS.
  6. Tried to install certbot again: snap install --classic certbot
  7. Got an error.
  8. Ran this cmd: ln -s /var/lib/snapd/snap /snap
  9. Again tried to install certbot: snap install --classic certbot
    This time it worked:
[root@localhost ~]# ln -s /var/lib/snapd/snap /snap
[root@localhost ~]# snap install --classic certbot
certbot 1.9.0 from Certbot Project (certbot-eff✓) installed
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.