snapd.service 无法在 Ubuntu 22.04.3 LTS 上启动

snapd.service 无法在 Ubuntu 22.04.3 LTS 上启动

我无法运行任何快照,因为 snapd.service 无法启动。

当我跑步时

sudo systemctl status snapd

我得到:

× snapd.service - Snap Daemon
     Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2024-02-06 13:52:47 EST; 22min ago
TriggeredBy: × snapd.socket
    Process: 11697 ExecStart=/usr/lib/snapd/snapd (code=exited, status=2)
   Main PID: 11697 (code=exited, status=2)
        CPU: 299ms

Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 5.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: Stopped Snap Daemon.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Start request repeated too quickly.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Failed with result 'exit-code'.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: Failed to start Snap Daemon.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Triggering OnFailure= dependencies.

当我跑步时

journalctl -e -u snapd

我得到:

Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: Started Snap Daemon.
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: panic: runtime error: invalid memory address or nil pointer dereference
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5597dc3b9495]
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: goroutine 42 [running]:
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate/configcore.validateCmdlineParamsAreAllowed(0xc0000f23f0, 0x5597dce68ec0, 0xc00058cba0, 0xc0006620b0, 0xd, 0xd, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configcore/kernel.go:68 +0x65
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate/configcore.validateCmdlineAppend(0x5597dce63e60, 0xc00040d020, 0x0, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configcore/kernel.go:100 +0x44e
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate/configcore.(*withStateHandler).validate(0xc0004647a0, 0x7f675ddae850, 0xc00040d020, 0x7f675ddae850, 0xc00040d020)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configcore/runwithstate.go:111 +0x6c
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate/configcore.applyHandlers(0x7f675d572c18, 0xc0005f15e0, 0x5597dce63e60, 0xc00040d020, 0xc00047e200, 0x1b, 0x20, 0xc0005f15e0, 0xc00040d020)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configcore/runwithstate.go:170 +0x30c
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate/configcore.Run(0x7f675d572c18, 0xc0005f15e0, 0x5597dce63e60, 0xc00040d020, 0xc00040d020, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configcore/runwithstate.go:149 +0x6f
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/configstate.Init.func1(0xc0002a1a40, 0xc0001e32c0, 0xc00054dc90)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/configstate/configmgr.go:68 +0x87
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/hookstate.(*HookManager).runHook(0xc0000be3c0, 0xc0002a1a40, 0xc00015aa00, 0xc0004c3640, 0xc0000bf180, 0x0, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/hookstate/hookmgr.go:402 +0x8f6
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/hookstate.(*HookManager).runHookForTask(0xc0000be3c0, 0xc0000c19e0, 0xc0000bf180, 0xc00015aa00, 0xc0004c3640, 0x0, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/hookstate/hookmgr.go:316 +0xba
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/hookstate.(*HookManager).doRunHook(0xc0000be3c0, 0xc0000c19e0, 0xc0000bf180, 0xc00e4af03b, 0x6faac8d9922)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/hookstate/hookmgr.go:268 +0x155
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: github.com/snapcore/snapd/overlord/state.(*TaskRunner).run.func1(0x0, 0x0)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/overlord/state/taskrunner.go:215 +0xca
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: gopkg.in/tomb%2ev2.(*Tomb).run(0xc0000bf180, 0xc000456f30)
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/vendor/gopkg.in/tomb.v2/tomb.go:163 +0x2d
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]: created by gopkg.in/tomb%2ev2.(*Tomb).Go
Feb 06 13:52:47 MAINTRUG1NB02222 snapd[11697]:         /build/snapd/parts/snapd-deb/build/vendor/gopkg.in/tomb.v2/tomb.go:159 +0xc9
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Failed with result 'exit-code'.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Scheduled restart job, restart counter is at 5.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: Stopped Snap Daemon.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Start request repeated too quickly.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Failed with result 'exit-code'.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: Failed to start Snap Daemon.
Feb 06 13:52:47 MAINTRUG1NB02222 systemd[1]: snapd.service: Triggering OnFailure= dependencies.

以下是有关我的机器的一些信息:

System:
  Host: MAINTRUG1NB02222 Kernel: 6.5.0-15-generic x86_64 bits: 64
    Desktop: GNOME 42.9 Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
Machine:
  Type: Laptop System: Dell product: Latitude 5420 Rugged v: N/A
    serial: <superuser required>
  Mobo: Dell model: 0GRR20 v: A03 serial: <superuser required> UEFI: Dell
    v: 1.23.0 date: 12/06/2022
Battery:
  ID-1: BAT0 charge: 34.6 Wh (100.0%) condition: 34.6/51.0 Wh (67.9%)
  ID-2: BAT1 charge: 32.6 Wh (97.0%) condition: 33.6/51.0 Wh (65.9%)
CPU:
  Info: quad core Intel Core i7-8650U [MT MCP] speed (MHz): avg: 3938
    min/max: 400/4200
Graphics:
  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
  Device-2: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
    driver: amdgpu v: kernel
  Device-3: Realtek Integrated_Webcam_HD type: USB driver: uvcvideo
  Display: x11 server: X.Org v: 1.21.1.4 driver: X:
    loaded: amdgpu,ati,modesetting unloaded: fbdev,radeon,vesa gpu: i915
    resolution: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2)
    v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1
Network:
  Device-1: Intel Ethernet I219-LM driver: e1000e
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB
    driver: r8152
Drives:
  Local Storage: total: 1.82 TiB used: 468.83 GiB (25.2%)
Info:
  Processes: 293 Uptime: 3h 7m Memory: 31.09 GiB used: 2.91 GiB (9.3%)
  Shell: Bash inxi: 3.3.13

我尝试通过以下方式重新安装 snapd

sudo apt purge --autoremove snapd

sudo apt install snapd

但是,我在清除时确实收到错误:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  snapd*
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
After this operation, 102 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 184708 files and directories currently installed.)
Removing snapd (2.58+22.04.1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
(Reading database ... 184615 files and directories currently installed.)
Purging configuration files for snapd (2.58+22.04.1) ...
Stopping snap-bare-5.mount
Stopping unit snap-bare-5.mount
Waiting until unit snap-bare-5.mount is stopped [attempt 1]
snap-bare-5.mount is stopped.
Removing snap bare and revision 5
Removing snap-bare-5.mount
Stopping snap-core20-1974.mount
Stopping unit snap-core20-1974.mount
Waiting until unit snap-core20-1974.mount is stopped [attempt 1]
snap-core20-1974.mount is stopped.
Removing snap core20 and revision 1974
Removing snap-core20-1974.mount
Stopping snap-core22-858.mount
Stopping unit snap-core22-858.mount
Waiting until unit snap-core22-858.mount is stopped [attempt 1]
snap-core22-858.mount is stopped.
Removing snap core22 and revision 858
Removing snap-core22-858.mount
Stopping snap-firefox-2971.mount
Stopping unit snap-firefox-2971.mount
Waiting until unit snap-firefox-2971.mount is stopped [attempt 1]
snap-firefox-2971.mount is stopped.
Removing snap firefox and revision 2971
rm: cannot remove '/var/snap/firefox/common/host-hunspell/en_US.aff': Read-only file system
rm: cannot remove '/var/snap/firefox/common/host-hunspell/en_US.dic': Read-only file system
dpkg: error processing package snapd (--purge):
 installed snapd package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我又遇到了之前遇到的同样的问题。重新安装后没有任何变化。

相关内容