Linux 磁盘空间清理:修订间差异
跳到导航
跳到搜索
无编辑摘要 |
(→Log) |
||
(未显示同一用户的2个中间版本) | |||
第13行: | 第13行: | ||
done</nowiki></small> | done</nowiki></small> | ||
See Also: [https://www.debugpoint.com/clean-up-snap/ How to Clean Up Snap Versions to Free Up Disk Space] | See Also: [https://www.debugpoint.com/clean-up-snap/ How to Clean Up Snap Versions to Free Up Disk Space] | ||
=== Log === | |||
/var/log/journal | |||
<small><nowiki># ./rrun mc.lis 'du -ms /var/log/journal' | |||
# vi /etc/systemd/journald.conf | |||
SystemMaxUse=16M | |||
ForwardToSyslog=no | |||
systemctl restart systemd-journald.service | |||
journalctl --verify</nowiki></small> | |||
[[分类:Develop]] | [[分类:Develop]] | ||
[[分类:Linux]] | [[分类:Linux]] | ||
[[分类:Shell]] | [[分类:Shell]] |
2025年1月7日 (二) 11:04的最新版本
Snap
Snap 会保留以前安装/卸载的软件包的旧版本。保留的版本数量,默认值为 3,包括当前安装版本。
- 修改保留版本数量: snap set system refresh.retain=2
- 保留的软件包列表: snap list --all
清理 Snap 的脚本:
#!/bin/bash # Removes old revisions of snaps # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do snap remove "$snapname" --revision="$revision" done
See Also: How to Clean Up Snap Versions to Free Up Disk Space
Log
/var/log/journal
# ./rrun mc.lis 'du -ms /var/log/journal' # vi /etc/systemd/journald.conf SystemMaxUse=16M ForwardToSyslog=no systemctl restart systemd-journald.service journalctl --verify