首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用snap返回安装certbot :如果存在,运行"certbot“的配置钩子

无法使用snap返回安装certbot :如果存在,运行"certbot“的配置钩子
EN

Server Fault用户
提问于 2021-10-04 02:53:20
回答 1查看 1.7K关注 0票数 0

我想使用snap安装certbot,但是当我尝试官方指令时:

代码语言:javascript
复制
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot

但返回:

错误:无法执行下列任务:

  • 运行"certbot“snap的配置钩子(运行钩子”配置“:/var/lib,而不是根拥有的1000:1000)

以前,我使用以下命令卸载certbot(从apt):

代码语言:javascript
复制
sudo apt-get remove -y certbot python3-certbot-apache

发生了什么?我用的是Bionic 18.04仿生

从错误中看,我需要将/var/lib的所有者更改为root用户。但我改变了,仍然犯了同样的错误。我应该递归地更改为根到那个文件夹吗?

下面是ls to /var/lib

代码语言:javascript
复制
drwxr-xr-x  4 myuser       myuser       4.0K Mar 10  2020 AccountsService
drwxr-xr-x  5 myuser       myuser       4.0K Mar 24  2020 apache2
drwxr-xr-x  5 myuser       myuser       4.0K Oct  4 02:36 apt
drwxr-xr-x  2 root      root      4.0K Sep  8 02:03 binfmts
drwxr-xr-x  2 myuser       myuser       4.0K May  5  2018 command-not-found
drwxr-xr-x  2 myuser       myuser       4.0K Mar 10  2020 dbus
drwxr-xr-x  2 myuser       myuser       4.0K Apr 16  2018 dhcp
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 dictionaries-common
drwxr-xr-x  7 myuser       myuser       4.0K Oct  4 02:36 dpkg
drwxr-xr-x  2 myuser       myuser       4.0K Dec  9  2019 git
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 grub
drwxr-xr-x  2 myuser       myuser       4.0K Oct  3 14:52 initramfs-tools
drwxr-xr-x  2 landscape landscape 4.0K Mar 10  2020 landscape
drwxr-xr-x  4 myuser       myuser       4.0K Oct  4 02:34 letsencrypt
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 locales
drwxr-xr-x  2 myuser       myuser       4.0K Oct  3 06:25 logrotate
drwxr-xr-x  2 root      root         0 Oct  4 02:56 lxcfs
drwxr-xr-x  2 lxd       nogroup   4.0K Jun 16 00:42 lxd
drwxr-xr-x  2 myuser       myuser       4.0K Mar 10  2020 man-db
drwxr-xr-x  2 myuser       myuser       4.0K Apr 24  2018 misc
drwxr-xr-x  2 myuser       myuser       4.0K Oct  3 06:25 mlocate
drwx------ 35 mysql     mysql     4.0K Oct  3 14:51 mysql
drwx------  2 mysql     mysql     4.0K Mar 24  2020 mysql-files
drwx------  2 mysql     mysql     4.0K Mar 24  2020 mysql-keyring
drwxr-xr-x  2 root      root      4.0K Jan 21  2020 mysql-upgrade
drwxr-xr-x  2 myuser       myuser       4.0K Oct  3 14:50 pam
drwxr-xr-x  4 myuser       myuser       4.0K Mar 24  2020 php
drwxr-xr-x  2 myuser       myuser       4.0K Apr  4  2019 plymouth
drwx------  3 myuser       myuser       4.0K Mar 10  2020 polkit-1
drwxr-xr-x  6 postgres  postgres  4.0K Oct  3 14:50 postgresql
drwx------  3 myuser       myuser       4.0K Mar 10  2020 private
drwxr-xr-x  2 myuser       myuser       4.0K Mar 24  2020 python
drwxr-x---  2 redis     redis     4.0K Feb 24  2021 redis
drwxr-xr-x 21 myuser       myuser       4.0K Oct  4 02:46 snapd
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 sudo
drwxr-xr-x  7 root      root      4.0K Oct  4 02:36 systemd
drwxr-xr-x  3 root      root      4.0K Jun 27 13:26 ubuntu-advantage
drwxr-xr-x  2 myuser       myuser       4.0K Oct  3 14:53 ubuntu-release-upgrader
drwxr-xr-x  3 myuser       myuser       4.0K Oct  3 14:52 ucf
drwxr-xr-x  2 myuser       myuser       4.0K Nov 25  2019 unattended-upgrades
drwxr-xr-x  2 myuser       myuser       4.0K Mar 10  2020 update-manager
drwxr-xr-x  4 myuser       myuser       4.0K Oct  4 02:44 update-notifier
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 ureadahead
drwxr-xr-x  2 myuser       myuser       4.0K Mar 10  2020 usbutils
drwxr-xr-x  3 myuser       myuser       4.0K Mar 10  2020 vim
EN

回答 1

Server Fault用户

发布于 2021-10-04 03:10:25

我只需要使用下面的命令将/var/lib/snapd文件夹更改为根用户:

代码语言:javascript
复制
chown root:root -R /var/lib/snapd/

在其他服务器中,/var/lib文件夹和内部由root拥有。我不知道为什么这个服务器上的文件夹的用户不是root用户,更改后我现在可以安装certbot并使用它了。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1079449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档