transmission提示"No space left on device"错误

发布时间 2023-07-08 23:25:19作者: 我心飞扬~

通过 df -h发现根目录空间已满

通过 du -h -x --max-depth=1找到/var/cache/apt/archives/lib/modules两个目录占用较大。

/var/cache/apt/archives的清理:

sudo apt-get clean

/lib/modules的清理:

先看一下当前使用的版本:
uname -a
使用命令查看目前已经安装的内核:
dpkg --get-selections|grep linux
我们发现,带有deinstall标志的行是旧内核,所以可以自动批量清除:
dpkg --get-selections|grep linux|grep deinstall|awk '{print $1}'|xargs apt-get purge -y
未带有deinstall标志的多余内核可以手动清除:
apt remove --purge linux-image-4.4.0-21-generic
最后更新引导系统:
update-grub