我的一个 snap 包在 Ubuntu 24.04 Desktop 上无法启动。删除该 snap 包并重新安装无效。经过一番快速研究后,我做出了一个愚蠢的决定:使用snapd
( apt-get
)删除它sudo apt-get remove snapd
。
我尝试了 3 天再次安装它,但没有任何结果。我删除了与 snap 相关的所有数据(备份了我的目录~/snap
)。这是我收到的错误消息:
$ sudo apt-get install snap snapd -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
snap snapd
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 28.4 MB of archives.
After this operation, 113 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 snapd amd64 2.63+24.04 [28.1 MB]
Get:2 http://archive.ubuntu.com/ubuntu noble/universe amd64 snap amd64 2013-11-29-11 [377 kB]
Fetched 28.4 MB in 15s (1,896 kB/s)
dpkg: warning: files list file for package 'libsnapd-glib-2-1:amd64' missing; assuming package has no files currently installed
(Reading database ... 355786 files and directories currently installed.)
Preparing to unpack .../snapd_2.63+24.04_amd64.deb ...
Unpacking snapd (2.63+24.04) ...
dpkg: error processing archive /var/cache/apt/archives/snapd_2.63+24.04_amd64.deb (--unpack):
error setting timestamps of '/usr/lib/snapd/snap-update-ns.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package snap.
Preparing to unpack .../snap_2013-11-29-11_amd64.deb ...
Unpacking snap (2013-11-29-11) ...
Errors were encountered while processing:
/var/cache/apt/archives/snapd_2.63+24.04_amd64.deb
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 181 files, found 144
E: Sub-process /usr/bin/dpkg returned an error code (1)
我清除了以下目录:
~/snap
/var/lib/snap
/var/snap
/var/lib/dpkg/info/libsnapd-glib-2-1:amd64*
sudo rm /var/cache/apt/archives/snapd_2.63+24.04_amd64.deb
sudo apt remove --purge snapd
sudo apt purge snapd snap-confine
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get --fix-broken install
sudo dpkg --configure -a
sudo apt install -f
sudo nano /etc/apt/preferences.d/nosnap.pref <- not there
然后重新启动系统并重新开始:
sudo apt-get install snapd
我不断收到有关时间戳的相同错误snap-update-ns.dpkg-new
,但该文件不存在。
有人能帮帮我吗?我在网上找不到解决方案。