刚刚从 bionic 升级到 cosmic。该过程的一部分从 deb lxd 迁移到 snap lxd。除 lxd 包外,升级成功。我在尝试完成升级或使用 snap 命令安装 lxd snap 时收到此错误。
snap install lxd
error: cannot perform the following tasks:
- Download snap "lxd" (10756) from channel "stable" (invalid credentials)
我为什么会得到这个?什么凭证?snapd 错误日志在哪里?
根据尝试回答的要求进行更新:
grep snap /var/log/syslog
:
May 30 00:21:14 delays snapd[30230]: storehelpers.go:441: cannot refresh snap "core": snap has no updates available
May 30 00:21:14 delays snapd[30230]: autorefresh.go:389: auto-refresh: all snaps are up-to-date
May 30 10:21:14 delays snapd[30230]: storehelpers.go:441: cannot refresh snap "core": snap has no updates available
May 30 10:21:14 delays snapd[30230]: autorefresh.go:389: auto-refresh: all snaps are up-to-date
May 30 15:11:14 delays snapd[30230]: storehelpers.go:441: cannot refresh snap "core": snap has no updates available
May 30 15:11:14 delays snapd[30230]: autorefresh.go:389: auto-refresh: all snaps are up-to-date
May 30 15:37:32 delays snapd[30230]: api.go:1079: Installing snap "lxd" revision unset
答案1
/var/log/syslog
你能在运行时提交内容sudo snap install lxd
吗?
为此,打开终端并输入:
$ grep snap /var/log/syslog
解决方案 #1
通常,当发生此错误时,您可以通过删除凭据~/.snap/auth.json
并尝试重新进行身份验证来解决此问题。
编辑:
解决方案 #2
首先,尝试停止snapd
$ sudo systemctl stop snapd.service
进行备份并删除/var/lib/snapd/state.json
$ sudo mv /var/lib/snapd/state.json /var/lib/snapd/state.json.bck
重新开始snapd
$ sudo systemctl start snapd.service
登录 Snap
$ snap login
更新所有 Snap 软件包
$ snap refresh
取出损坏的 Snap
$ snap remove lxd
尝试再次安装 lxd
$ snap install lxd
答案2
您可以尝试使用 sudo 前缀安装 lxd,如下所示:
sudo snap install lxd
答案3
无意中发现了解决办法:
1- 退出 snap:
#snap logout
2-前往Settings --> Online Accounts
并删除您拥有的所有帐户。
3-现在简单来说:
#snap refresh