Ubuntu20.04 /dev/loop0目录满了自动清理
/dev/loop0/目录显示 文件100%
root@huawei-2288H-V5:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 126G 0 126G 0% /dev tmpfs 26G 3.8M 26G 1% /run /dev/sdg3 175G 8.6G 157G 6% / tmpfs 126G 0 126G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 126G 0 126G 0% /sys/fs/cgroup /dev/loop1 128K 128K 0 100% /snap/bare/5 /dev/loop0 55M 55M 0 100% /snap/core18/1705 /dev/loop2 56M 56M 0 100% /snap/core18/2538 /dev/loop4 219M 219M 0 100% /snap/gnome-3-34-1804/77 /dev/loop3 62M 62M 0 100% /snap/core20/1587 /dev/loop5 241M 241M 0 100% /snap/gnome-3-34-1804/24 /dev/loop7 47M 47M 0 100% /snap/snapd/16292 /dev/loop8 63M 63M 0 100% /snap/gtk-common-themes/1506 /dev/loop10 55M 55M 0 100% /snap/snap-store/558 /dev/loop11 50M 50M 0 100% /snap/snap-store/433 /dev/loop6 401M 401M 0 100% /snap/gnome-3-38-2004/112 /dev/loop9 92M 92M 0 100% /snap/gtk-common-themes/1535 /dev/sda1 200M 17M 184M 9% /boot/efi tmpfs 26G 20K 26G 1% /run/user/125 tmpfs 26G 0 26G 0% /run/user/0 /dev/loop12 62M 62M 0 100% /snap/core20/1593 tmpfs 26G 8.0K 26G 1% /run/user/1000 /dev/sdc1 7.3T 4.6T 2.8T 63% /media/fnadmin/68523100-87b3-4008-944d-267fb4da25ac /dev/sde1 7.3T 4.9T 2.4T 68% /media/fnadmin/afa00880-5739-4e2b-84be-9463fd0603dc /dev/sdd1 7.3T 6.9T 430G 95% /media/fnadmin/cd7ad85c-52a8-4167-8a65-e84d16aa143c /dev/sdf1 7.3T 2.5G 7.3T 1% /media/fnadmin/f6c7f784-c757-4c4a-bd49-c7e0a6d73fc8 /dev/mapper/centos-home 7.3T 1.9T 5.5T 25% /media/fnadmin/b446eec0-8f6a-4bdc-ab55-b08e8cef21f9
调用以下命令进行清理:
sudo apt autoremove --purge snapd
执行清理代码过程:
root@huawei-2288H-V5:~$ sudo apt autoremove --purge snapd [sudo] password for fnadmin: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包将被【卸载】: snapd* 升级了 0 个软件包,新安装了 0 个软件包,要卸载 1 个软件包,有 290 个软件包未被升级。 解压缩后将会空出 147 MB 的空间。 您希望继续执行吗? [Y/n] y (正在读取数据库 ... 系统当前共安装有 181666 个文件和目录。) 正在卸载 snapd (2.54.3+20.04.1ubuntu0.2) ... 正在处理用于 mime-support (3.64ubuntu1) 的触发器 ... 正在处理用于 gnome-menus (3.36.0-1ubuntu1) 的触发器 ... 正在处理用于 man-db (2.9.1-1) 的触发器 ... 正在处理用于 dbus (1.12.16-2ubuntu2.2) 的触发器 ... 正在处理用于 desktop-file-utils (0.24-1ubuntu2) 的触发器 ... (正在读取数据库 ... 系统当前共安装有 181582 个文件和目录。) 正在清除 snapd (2.54.3+20.04.1ubuntu0.2) 的配置文件 ... 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-core18-1705.mount Stopping unit snap-core18-1705.mount Waiting until unit snap-core18-1705.mount is stopped [attempt 1] snap-core18-1705.mount is stopped. Removing snap core18 and revision 1705 Removing snap-core18-1705.mount Stopping snap-core18-2538.mount Stopping unit snap-core18-2538.mount Waiting until unit snap-core18-2538.mount is stopped [attempt 1] snap-core18-2538.mount is stopped. Removing snap core18 and revision 2538 Removing snap-core18-2538.mount Stopping snap-core20-1587.mount Stopping unit snap-core20-1587.mount Waiting until unit snap-core20-1587.mount is stopped [attempt 1] snap-core20-1587.mount is stopped. Removing snap core20 and revision 1587 Removing snap-core20-1587.mount Stopping snap-core20-1593.mount Stopping unit snap-core20-1593.mount Waiting until unit snap-core20-1593.mount is stopped [attempt 1] snap-core20-1593.mount is stopped. Removing snap core20 and revision 1593 Removing snap-core20-1593.mount Stopping snap-gnome\x2d3\x2d34\x2d1804-24.mount Stopping unit snap-gnome\x2d3\x2d34\x2d1804-24.mount Waiting until unit snap-gnome\x2d3\x2d34\x2d1804-24.mount is stopped [attempt 1] snap-gnome\x2d3\x2d34\x2d1804-24.mount is stopped. Removing snap gnome-3-34-1804 and revision 24 Removing snap-gnome\x2d3\x2d34\x2d1804-24.mount Stopping snap-gnome\x2d3\x2d34\x2d1804-77.mount Stopping unit snap-gnome\x2d3\x2d34\x2d1804-77.mount Waiting until unit snap-gnome\x2d3\x2d34\x2d1804-77.mount is stopped [attempt 1] snap-gnome\x2d3\x2d34\x2d1804-77.mount is stopped. Removing snap gnome-3-34-1804 and revision 77 Removing snap-gnome\x2d3\x2d34\x2d1804-77.mount Stopping snap-gnome\x2d3\x2d38\x2d2004-112.mount Stopping unit snap-gnome\x2d3\x2d38\x2d2004-112.mount Waiting until unit snap-gnome\x2d3\x2d38\x2d2004-112.mount is stopped [attempt 1] snap-gnome\x2d3\x2d38\x2d2004-112.mount is stopped. Removing snap gnome-3-38-2004 and revision 112 Removing snap-gnome\x2d3\x2d38\x2d2004-112.mount Stopping snap-gtk\x2dcommon\x2dthemes-1506.mount Stopping unit snap-gtk\x2dcommon\x2dthemes-1506.mount Waiting until unit snap-gtk\x2dcommon\x2dthemes-1506.mount is stopped [attempt 1] snap-gtk\x2dcommon\x2dthemes-1506.mount is stopped. Removing snap gtk-common-themes and revision 1506 Removing snap-gtk\x2dcommon\x2dthemes-1506.mount Stopping snap-gtk\x2dcommon\x2dthemes-1535.mount Stopping unit snap-gtk\x2dcommon\x2dthemes-1535.mount Waiting until unit snap-gtk\x2dcommon\x2dthemes-1535.mount is stopped [attempt 1] snap-gtk\x2dcommon\x2dthemes-1535.mount is stopped. Removing snap gtk-common-themes and revision 1535 Removing snap-gtk\x2dcommon\x2dthemes-1535.mount Stopping snap-snap\x2dstore-433.mount Stopping unit snap-snap\x2dstore-433.mount Waiting until unit snap-snap\x2dstore-433.mount is stopped [attempt 1] snap-snap\x2dstore-433.mount is stopped. Removing snap snap-store and revision 433 Removing snap-snap\x2dstore-433.mount Stopping snap-snap\x2dstore-558.mount Stopping unit snap-snap\x2dstore-558.mount Waiting until unit snap-snap\x2dstore-558.mount is stopped [attempt 1] snap-snap\x2dstore-558.mount is stopped. Removing snap snap-store and revision 558 Removing snap-snap\x2dstore-558.mount Stopping snap-snapd-16292.mount Stopping unit snap-snapd-16292.mount Waiting until unit snap-snapd-16292.mount is stopped [attempt 1] snap-snapd-16292.mount is stopped. Removing snap snapd and revision 16292 Removing snap-snapd-16292.mount Discarding preserved snap namespaces Final directory cleanup Removing extra snap-confine apparmor rules Removing snapd cache Removing snapd state
执行结果:
root@huawei-2288H-V5:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 126G 0 126G 0% /dev tmpfs 26G 3.9M 26G 1% /run /dev/sdg3 175G 7.0G 159G 5% / tmpfs 126G 0 126G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 126G 0 126G 0% /sys/fs/cgroup /dev/sda1 200M 17M 184M 9% /boot/efi tmpfs 26G 20K 26G 1% /run/user/125 tmpfs 26G 0 26G 0% /run/user/0 tmpfs 26G 8.0K 26G 1% /run/user/1000 /dev/sdc1 7.3T 4.6T 2.8T 63% /media/fnadmin/68523100-87b3-4008-944d-267fb4da25ac /dev/sde1 7.3T 4.9T 2.4T 68% /media/fnadmin/afa00880-5739-4e2b-84be-9463fd0603dc /dev/sdd1 7.3T 6.9T 430G 95% /media/fnadmin/cd7ad85c-52a8-4167-8a65-e84d16aa143c /dev/sdf1 7.3T 2.5G 7.3T 1% /media/fnadmin/f6c7f784-c757-4c4a-bd49-c7e0a6d73fc8 /dev/mapper/centos-home 7.3T 1.9T 5.5T 25% /media/fnadmin/b446eec0-8f6a-4bdc-ab55-b08e8cef21f9