我最近遇到了一个问题/usr/lib/snapd/snapd
。它消耗了我所有的带宽。可能是它正在更新我的 snap 应用。但目前我正在使用我的 Ubuntu 桌面使用我的移动数据。
有些帖子建议将我的连接设置为计量连接,这已经完成了。另一种方法是屏蔽 snapd.service,这样我就无法使用任何已安装的 snap。
journalctl --no-pager -u snapd
给出以下日志:
Dec 07 08:33:42 CDEK systemd[1]: Starting snapd.service - Snap Daemon...
Dec 07 08:33:42 CDEK snapd[1360]: overlord.go:272: Acquiring state lock file
Dec 07 08:33:42 CDEK snapd[1360]: overlord.go:277: Acquired state lock file
Dec 07 08:33:42 CDEK snapd[1360]: daemon.go:247: started snapd/2.60.4+23.10.1 (series 16; classic) ubuntu/23.10 (amd64) linux/6.5.0-13-generic.
Dec 07 08:33:43 CDEK snapd[1360]: daemon.go:340: adjusting startup timeout by 3m0s (pessimistic estimate of 30s plus 5s per snap)
Dec 07 08:33:43 CDEK snapd[1360]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Dec 07 08:33:44 CDEK systemd[1]: Started snapd.service - Snap Daemon.
Dec 07 08:34:17 CDEK snapd[1360]: stateengine.go:149: state ensure error: Get "https://api.snapcraft.io/api/v1/snaps/sections": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 08:43:44 CDEK snapd[1360]: devicemgr.go:2361: no NTP sync after 10m0s, trying auto-refresh anyway
Dec 07 08:43:46 CDEK snapd[1360]: storehelpers.go:773: cannot refresh: snap has no updates available: "0ad", "bare", "chromium-ffmpeg", "core18", "core20", "core22", "cups", "firefox", "firmware-updater", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "mailspring", "onlyoffice-desktopeditors", "qt515-core20", "snap-store", "snapd", "snapd-desktop-integration", "steam", "ultimate-media-downloader"
Dec 07 08:51:31 CDEK snapd[1360]: storehelpers.go:773: cannot refresh: snap has no updates available: "0ad", "bare", "brave", "chromium-ffmpeg", "core20", "core22", "cups", "firmware-updater", "gaming-graphics-core22", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "mailspring", "onlyoffice-desktopeditors", "opera", "qt515-core20", "snap-store", "snapd", "snapd-desktop-integration", "steam", "ultimate-media-downloader"
Dec 07 08:52:08 CDEK snapd[1360]: store_download.go:213: Cannot download or apply deltas for android-studio: Get "https://api.snapcraft.io/api/v1/snaps/download/VNTeIi51l6cIZ1gaWHwx0PoP7JaCb61c_128_136_xdelta3.delta": net/http: timeout awaiting response headers
Dec 07 08:53:28 CDEK snapd[1360]: store_download.go:213: Cannot download or apply deltas for pycharm-professional: read tcp 192.168.43.195:46382->91.189.91.42:443: read: network is unreachable
Dec 07 08:53:28 CDEK snapd[1360]: taskrunner.go:299: [change 62 "Download snap \"pycharm-professional\" (361) from channel \"latest/stable\"" task] failed: Get "https://api.snapcraft.io/api/v1/snaps/download/Uqpw0ZWqy6Wh4mgaWE0rxgM5tAGCwf4D_361.snap": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 08:54:25 CDEK snapd[1360]: store_download.go:213: Cannot download or apply deltas for phpstorm: read tcp 192.168.43.195:35296->91.189.91.42:443: read: connection timed out
Dec 07 08:55:18 CDEK snapd[1360]: store_download.go:213: Cannot download or apply deltas for intellij-idea-ultimate: read tcp [2402:3a80:1a4e:e217:946b:1234:406a:1fbf]:47760->[2402:3a80:1fff:3f::b97d:be1b]:443: read: connection reset by peer
Dec 07 09:03:02 CDEK snapd[1360]: taskrunner.go:299: [change 62 "Download snap \"android-studio\" (136) from channel \"latest/stable\"" task] failed: read tcp 192.168.43.195:47124->91.189.91.43:443: read: connection timed out
Dec 07 09:03:13 CDEK snapd[1360]: store_download.go:213: Cannot download or apply deltas for clion: read tcp 192.168.43.195:48282->91.189.91.43:443: read: connection timed out
Dec 07 09:06:04 CDEK snapd[1360]: taskrunner.go:299: [change 62 "Download snap \"intellij-idea-ultimate\" (467) from channel \"latest/stable\"" task] failed: read tcp [2402:3a80:1a4e:e217:946b:1234:406a:1fbf]:47686->[2402:3a80:1fff:3f::b97d:be1a]:443: read: connection reset by peer
Dec 07 09:06:56 CDEK snapd[1360]: taskrunner.go:299: [change 62 "Download snap \"phpstorm\" (365) from channel \"latest/stable\"" task] failed: read tcp 192.168.43.195:50170->91.189.91.43:443: read: connection reset by peer
Dec 07 09:11:15 CDEK systemd[1]: snapd.service: Got notification message from PID 1360, but reception is disabled.
Dec 07 09:12:42 CDEK systemd[1]: snapd.service: Main process exited, code=killed, status=9/KILL
Dec 07 09:12:42 CDEK systemd[1]: snapd.service: Failed with result 'signal'.
Dec 07 09:12:42 CDEK systemd[1]: snapd.service: Consumed 3min 50.906s CPU time.
-- Boot 59c8b95785fb4d3399984ae324305348 --
Dec 07 09:32:06 CDEK systemd[1]: Starting snapd.service - Snap Daemon...
Dec 07 09:32:06 CDEK snapd[4044]: overlord.go:272: Acquiring state lock file
Dec 07 09:32:06 CDEK snapd[4044]: overlord.go:277: Acquired state lock file
Dec 07 09:32:06 CDEK snapd[4044]: daemon.go:247: started snapd/2.60.4+23.10.1 (series 16; classic) ubuntu/23.10 (amd64) linux/6.5.0-13-generic.
Dec 07 09:32:06 CDEK snapd[4044]: daemon.go:340: adjusting startup timeout by 3m0s (pessimistic estimate of 30s plus 5s per snap)
Dec 07 09:32:06 CDEK snapd[4044]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Dec 07 09:32:07 CDEK systemd[1]: Started snapd.service - Snap Daemon.
Dec 07 09:32:39 CDEK snapd[4044]: stateengine.go:149: state ensure error: Get "https://api.snapcraft.io/api/v1/snaps/sections": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 09:34:01 CDEK snapd[4044]: store_download.go:213: Cannot download or apply deltas for clion: Get "https://api.snapcraft.io/api/v1/snaps/download/6JBjLwyVchga4cOSDqhWJd9NgQfrTYam_250_259_xdelta3.delta": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 09:35:22 CDEK snapd[4044]: taskrunner.go:299: [change 62 "Download snap \"clion\" (259) from channel \"latest/stable\"" task] failed: Get "https://api.snapcraft.io/api/v1/snaps/download/6JBjLwyVchga4cOSDqhWJd9NgQfrTYam_259.snap": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 09:35:54 CDEK snapd[4044]: taskrunner.go:299: [change 62 "Handling re-refresh of \"android-studio\", \"brave\", \"clion\", \"gaming-graphics-core22\", \"intellij-idea-ultimate\", \"opera\", \"phpstorm\", \"pycharm-professional\" as needed" task] failed: Post "https://api.snapcraft.io/v2/snaps/refresh": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 09:59:41 CDEK snapd[4044]: storehelpers.go:773: cannot refresh: snap has no updates available: "0ad", "bare", "brave", "chromium-ffmpeg", "core20", "core22", "cups", "firmware-updater", "gaming-graphics-core22", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "mailspring", "onlyoffice-desktopeditors", "opera", "qt515-core20", "snap-store", "snapd", "snapd-desktop-integration", "steam", "ultimate-media-downloader"
Dec 07 12:12:10 CDEK snapd[4044]: storehelpers.go:773: cannot refresh: snap has no updates available: "0ad", "bare", "brave", "chromium-ffmpeg", "core20", "core22", "cups", "firefox", "firmware-updater", "gaming-graphics-core22", "gnome-3-28-1804", "gnome-3-34-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "mailspring", "onlyoffice-desktopeditors", "opera", "qt515-core20", "snap-store", "snapd", "snapd-desktop-integration", "steam", "ultimate-media-downloader"
Dec 07 12:21:39 CDEK snapd[4044]: store_download.go:213: Cannot download or apply deltas for clion: Get "https://api.snapcraft.io/api/v1/snaps/download/6JBjLwyVchga4cOSDqhWJd9NgQfrTYam_250_259_xdelta3.delta": net/http: timeout awaiting response headers
Dec 07 12:21:41 CDEK snapd[4044]: store_download.go:213: Cannot download or apply deltas for pycharm-professional: Get "https://api.snapcraft.io/api/v1/snaps/download/Uqpw0ZWqy6Wh4mgaWE0rxgM5tAGCwf4D_359_361_xdelta3.delta": read tcp 192.168.43.195:56280->185.125.188.54:443: read: connection reset by peer
Dec 07 12:22:33 CDEK systemd[1]: snapd.service: Main process exited, code=killed, status=9/KILL
Dec 07 12:22:33 CDEK systemd[1]: snapd.service: Failed with result 'signal'.
Dec 07 12:22:33 CDEK systemd[1]: snapd.service: Consumed 1min 29.034s CPU time.
Dec 07 12:22:33 CDEK systemd[1]: snapd.service: Scheduled restart job, restart counter is at 1.
Dec 07 12:22:33 CDEK systemd[1]: Stopped snapd.service - Snap Daemon.
Dec 07 12:22:33 CDEK systemd[1]: snapd.service: Consumed 1min 29.034s CPU time.
Dec 07 12:22:33 CDEK systemd[1]: Starting snapd.service - Snap Daemon...
Dec 07 12:22:34 CDEK snapd[19518]: overlord.go:272: Acquiring state lock file
Dec 07 12:22:34 CDEK snapd[19518]: overlord.go:277: Acquired state lock file
Dec 07 12:22:34 CDEK snapd[19518]: daemon.go:247: started snapd/2.60.4+23.10.1 (series 16; classic) ubuntu/23.10 (amd64) linux/6.5.0-13-generic.
Dec 07 12:22:34 CDEK snapd[19518]: daemon.go:340: adjusting startup timeout by 3m0s (pessimistic estimate of 30s plus 5s per snap)
Dec 07 12:22:34 CDEK snapd[19518]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Dec 07 12:22:34 CDEK systemd[1]: Started snapd.service - Snap Daemon.
Dec 07 12:23:19 CDEK snapd[19518]: stateengine.go:149: state ensure error: decode new commands catalog: net/http: request canceled (Client.Timeout or context cancellation while reading body)
Dec 07 12:23:38 CDEK systemd[1]: snapd.service: Main process exited, code=killed, status=9/KILL
Dec 07 12:23:38 CDEK systemd[1]: snapd.service: Failed with result 'signal'.
Dec 07 12:23:38 CDEK systemd[1]: snapd.service: Consumed 3.875s CPU time.
Dec 07 12:23:38 CDEK systemd[1]: snapd.service: Scheduled restart job, restart counter is at 2.
Dec 07 12:23:38 CDEK systemd[1]: Stopped snapd.service - Snap Daemon.
Dec 07 12:23:38 CDEK systemd[1]: snapd.service: Consumed 3.875s CPU time.
Dec 07 12:23:38 CDEK systemd[1]: Starting snapd.service - Snap Daemon...
Dec 07 12:23:38 CDEK snapd[19634]: overlord.go:272: Acquiring state lock file
Dec 07 12:23:38 CDEK snapd[19634]: overlord.go:277: Acquired state lock file
Dec 07 12:23:38 CDEK snapd[19634]: daemon.go:247: started snapd/2.60.4+23.10.1 (series 16; classic) ubuntu/23.10 (amd64) linux/6.5.0-13-generic.
Dec 07 12:23:38 CDEK snapd[19634]: daemon.go:340: adjusting startup timeout by 3m0s (pessimistic estimate of 30s plus 5s per snap)
Dec 07 12:23:38 CDEK snapd[19634]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Dec 07 12:23:39 CDEK systemd[1]: Started snapd.service - Snap Daemon.
Dec 07 12:23:53 CDEK snapd[19634]: stateengine.go:149: state ensure error: decode new commands catalog: net/http: request canceled (Client.Timeout or context cancellation while reading body)
Dec 07 12:25:27 CDEK snapd[19634]: store_download.go:213: Cannot download or apply deltas for clion: Get "https://canonical-bos01.cdn.snapcraftcontent.com/download-origin/canonical-lgw01/6JBjLwyVchga4cOSDqhWJd9NgQfrTYam_250_259_xdelta3.delta?interactive=1&token=1701943200_99c67043ef9cda4fbdc02a671436154e641b695c": net/http: timeout awaiting response headers
Dec 07 12:25:32 CDEK snapd[19634]: store_download.go:213: Cannot download or apply deltas for intellij-idea-ultimate: Get "https://api.snapcraft.io/api/v1/snaps/download/i5O0FAhwADbvDr8LYQ6jVHxPEJle7m6C_462_467_xdelta3.delta": read tcp 192.168.43.195:50650->185.125.188.54:443: read: connection reset by peer
Dec 07 12:27:25 CDEK snapd[19634]: store_download.go:213: Cannot download or apply deltas for android-studio: read tcp [2402:3a80:1a4e:e217:4c8d:b841:2876:cf5b]:43288->[2402:3a80:1fff:3f::5bbd:5b2a]:443: read: network is unreachable
Dec 07 12:28:12 CDEK snapd[19634]: store_download.go:213: Cannot download or apply deltas for pycharm-professional: read tcp 192.168.43.195:56416->91.189.91.42:443: read: connection timed out
Dec 07 12:28:12 CDEK snapd[19634]: store_download.go:213: Cannot download or apply deltas for phpstorm: read tcp 192.168.43.195:56428->91.189.91.42:443: read: connection timed out
Dec 07 12:28:12 CDEK snapd[19634]: taskrunner.go:299: [change 63 "Download snap \"intellij-idea-ultimate\" (467) from channel \"latest/stable\"" task] failed: Get "https://api.snapcraft.io/api/v1/snaps/download/i5O0FAhwADbvDr8LYQ6jVHxPEJle7m6C_467.snap": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 12:28:12 CDEK snapd[19634]: taskrunner.go:299: [change 63 "Download snap \"clion\" (259) from channel \"latest/stable\"" task] failed: Get "https://api.snapcraft.io/api/v1/snaps/download/6JBjLwyVchga4cOSDqhWJd9NgQfrTYam_259.snap": dial tcp: lookup api.snapcraft.io on 127.0.0.53:53: server misbehaving
Dec 07 12:29:55 CDEK snapd[19634]: main.go:155: Exiting on terminated signal.
Dec 07 12:29:55 CDEK systemd[1]: Stopping snapd.service...
Dec 07 12:29:55 CDEK systemd[1]: snapd.service: Got notification message from PID 19634, but reception is disabled.
Dec 07 12:29:55 CDEK snapd[19634]: overlord.go:516: Released state lock file
Dec 07 12:29:55 CDEK systemd[1]: snapd.service: Deactivated successfully.
Dec 07 12:29:55 CDEK systemd[1]: Stopped snapd.service.
Dec 07 12:29:55 CDEK systemd[1]: snapd.service: Consumed 45.307s CPU time.
Dec 07 13:16:40 CDEK systemd[1]: Starting snapd.service - Snap Daemon...
Dec 07 13:16:40 CDEK snapd[21771]: overlord.go:272: Acquiring state lock file
Dec 07 13:16:40 CDEK snapd[21771]: overlord.go:277: Acquired state lock file
Dec 07 13:16:40 CDEK snapd[21771]: daemon.go:247: started snapd/2.60.4+23.10.1 (series 16; classic) ubuntu/23.10 (amd64) linux/6.5.0-13-generic.
Dec 07 13:16:40 CDEK snapd[21771]: daemon.go:340: adjusting startup timeout by 3m0s (pessimistic estimate of 30s plus 5s per snap)
Dec 07 13:16:40 CDEK snapd[21771]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
Dec 07 13:16:40 CDEK systemd[1]: Started snapd.service - Snap Daemon.
Dec 07 13:33:43 CDEK snapd[21771]: main.go:155: Exiting on terminated signal.
Dec 07 13:33:43 CDEK systemd[1]: Stopping snapd.service - Snap Daemon...
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: State 'stop-sigterm' timed out. Killing.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Killing process 21771 (snapd) with signal SIGKILL.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Killing process 21776 (snapd) with signal SIGKILL.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Killing process 21782 (n/a) with signal SIGKILL.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Killing process 22035 (n/a) with signal SIGKILL.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Main process exited, code=killed, status=9/KILL
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Failed with result 'timeout'.
Dec 07 13:35:13 CDEK systemd[1]: Stopped snapd.service.
Dec 07 13:35:13 CDEK systemd[1]: snapd.service: Consumed 1min 51.484s CPU time.
答案1
您可能正在运行一个 lxc 容器,它会定期运行 snap。要检查和删除的命令如下:
sudo lxc list -c n -f compact
sudo lxc delete <container-name> --force