Permissions

snap-store 或基本上任何快照應用程序都無法執行:user-dirs.dirs: Permission denied

  • March 29, 2022

我正在執行幾個隨 Snap Store 一起安裝的應用程序。有段時間沒用系統,瞎跑

sudo apt-get update
sudo apt-get upgrade
sudo snap refresh

重啟bdzink後。當我啟動這些應用程序中的任何一個甚至是快照儲存本身時,它都會默默地完成。其他一切都按預期工作。

為了更好地診斷問題,我嘗試使用命令行啟動應用程序:

pdebski@system:~$ ps -ea | grep snap
   764 ?        00:00:01 snapd
pdebski@system:~$ snap list
Name                     Version                     Rev   Tracking       Publisher   Notes
chromium                 83.0.4103.61                1165  latest/stable  canonical✓  -
core                     16-2.45                     9289  latest/stable  canonical✓  core
core18                   20200427                    1754  latest/stable  canonical✓  base
gnome-3-28-1804          3.28.0-17-gde3d74c.de3d74c  128   latest/stable  canonical✓  -
gtk-common-themes        0.1-36-gc75f853             1506  latest/stable  canonical✓  -
kde-frameworks-5-core18  5.61.0                      32    latest/stable  kde✓        -
midori                   v8.0-31-gf6b3b1e            550   latest/stable  kalikiana   -
snap-store               3.31.1+git187.84b64e0b      415   latest/stable  canonical✓  -
snapd                    2.45                        7777  latest/stable  canonical✓  snapd
pdebski@system:~$ snap run snap-store
/snap/snap-store/415/bin/desktop-launch: line 51: /home/pdebski/.config/user-dirs.dirs: Permission denied
18:13:30:0737 GLib-GIO g_app_info_get_name: assertion 'G_IS_APP_INFO (appinfo)' failed
18:13:30:0740 Gtk Failed to load module "appmenu-gtk-module"
Unable to init server: Could not connect: Connection refused
18:13:30:0746 Gtk cannot open display: :1
pdebski@system:~$ ls -l .co*/u*s
-rw------- 1 pdebski pdebski 632 mar 21  2018 .config/user-dirs.dirs

我不希望user-dirs.dirs我的主目錄中的任何其他文件是世界可讀的,但是我更改了權限以檢查會發生什麼:

pdebski@system:~/.config$ chmod go+r u*s
pdebski@system:~/.config$ ls -ld .
drwxr-xr-x 27 pdebski pdebski 4096 cze  5 19:52 .
pdebski@system:~/.config$ ls -al u*
-rw-r--r--  1 pdebski pdebski  632 mar 21  2018 user-dirs.dirs
pdebski@system:~/.config$ ls -ald ../.c*g
drwxr-xr-x 27 pdebski pdebski 4096 cze  5 19:52 ../.config
pdebski@system:~/.config$ snap-store
/snap/snap-store/415/bin/desktop-launch: line 51: /home/pdebski/.config/user-dirs.dirs: Permission denied
20:45:44:0906 GLib-GIO g_app_info_get_name: assertion 'G_IS_APP_INFO (appinfo)' failed
20:45:44:0951 Gtk Failed to load module "appmenu-gtk-module"
Unable to init server: Could not connect: Connection refused
20:45:45:0012 Gtk cannot open display: :1

我被困住了。怎麼了?

我有 manjaro 但這個問題已經好幾次了,快速重新安裝快照商店解決了這個問題(嘗試按照他們的說明https://snapcraft.io/snap-store

現在我有矩形而不是文本字元,我可以通過以下方式解決:

sudo rm /var/cache/fontconfig/*
sudo rm ~/.cache/fontconfig/*

謝謝@borabora 確實重新安裝 snap-store 有助於:

$ snap help
The snap command lets you install, configure, refresh and remove snaps.
Snaps are packages that work across many different Linux distributions,
enabling secure delivery and operation of the latest apps and utilities.

Usage: snap <command> [<options>...]

Commands can be classified as follows:

        Basics: find, info, install, list, remove
       ...more: refresh, revert, switch, disable, enable
       History: changes, tasks, abort, watch
       Daemons: services, start, stop, restart, logs
      Commands: alias, aliases, unalias, prefer
 Configuration: get, set, unset, wait
       Account: login, logout, whoami
   Permissions: connections, interface, connect, disconnect
     Snapshots: saved, save, check-snapshot, restore, forget
         Other: version, warnings, okay, ack, known, model, create-cohort
   Development: run, pack, try, download, prepare-image

For more information about a command, run 'snap help <command>'.
For a short summary of all commands, run 'snap help --all'.
$ snap refresh snap-store
snap "snap-store" has no updates available
$ snap remove snap-store
snap-store removed
$ snap install snap-store
snap-store 3.31.1+git187.84b64e0b from Canonical✓ installed
$ snap-store
21:58:29:0941 Gtk Failed to load module "appmenu-gtk-module"
21:58:30:0253 GsPluginOdrs failed to get distro name: Failed to open file “/var/lib/snapd/hostfs/etc/os-release”: Permission denied
21:58:30:0287 Gs  enabled plugins: odrs, rewrite-resource, snap, icons, key-colors, key-colors-metadata
21:58:30:0288 Gs  disabled plugins: appstream, desktop-categories, desktop-menu-path, dpkg, dummy, epiphany, fedora-pkgdb-collections, generic-updates, hardcoded-blacklist, hardcoded-featured, hardcoded-popular, modalias, os-release, provenance, provenance-license, repos, shell-extensions
21:58:34:0513 Gs  failed to create an app for */*/*/*/system/*
21:58:34:0516 Gs  updates-shell: failed to get updates: no plugin could handle get-updates
21:58:34:0516 Gs  failed to create an app for */*/*/*/system/*
21:58:34:0516 Gs  failed to get system app
21:58:34:0541 GsPluginSnap Failed to load snap icon: local snap has no icon
21:58:34:0552 Gs  Only 0 apps for recent list, hiding
21:58:34:0565 Gs  hiding category graphics featured applications: found only 0 to show, need at least 9
21:58:34:0777 Gs  hiding category audio-video featured applications: found only 0 to show, need at least 9
21:58:35:0147 GsPluginSnap Failed to load snap icon: local snap has no icon
21:58:35:0350 GsPluginSnap Failed to load snap icon: local snap has no icon
21:58:35:0767 GsPluginSnap Failed to load snap icon: local snap has no icon

(出現快照儲存視窗)

注意不同的錯誤消息 - 顯然快照儲存質量需要更多改進。

可能在系統更新核心或某些庫更新期間破壞了兼容性。無需重新安裝其他 Snap 應用程序。為所有其他應用程序自動重新安裝商店固定的先決條件。

引用自:https://unix.stackexchange.com/questions/591130