大网数据广告活动
服务器运维问答

Can I delete folders in /lib/modules/ after calling "apt-get purge"

· 52CE 我爱测

I've already call apt-get purge to uninstall the old kernels. But some error occured during the purge that caused the folders to be left behind. It said the folder was not empty so it couldn't delete. To free up disk space can I …

问题原文

原帖链接 · Dalton Tan · CC BY-SA 4.0

I've already call apt-get purge to uninstall the old kernels. But some error occured during the purge that caused the folders to be left behind. It said the folder was not empty so it couldn't delete. To free up disk space can I manually delete those folders that I've purged?

1.1M    ./4.15.0-20-generic
60M     ./4.15.0-32-generic <-- I've purged this
60M     ./4.15.0-30-generic <-- and this
236M    ./4.15.0-33-generic <-- this is my current one

Can I also remove some of these packages?

un  linux-headers-4.15.0-20-generic                       <none>                          <none>                          (no description available)
ii  linux-headers-4.15.0-30                               4.15.0-30.32                    all                             Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-30-generic                       4.15.0-30.32                    amd64                           Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-4.15.0-32                               4.15.0-32.35                    all                             Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-32-generic                       4.15.0-32.35                    amd64                           Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-4.15.0-33                               4.15.0-33.36                    all                             Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-33-generic                       4.15.0-33.36                    amd64                           Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
rc  linux-image-4.15.0-20-generic                         4.15.0-20.21                    amd64                           Signed kernel image generic
ii  linux-image-4.15.0-33-generic                         4.15.0-33.36                    amd64                           Signed kernel image generic
un  linux-image-unsigned-4.15.0-20-generic                <none>                          <none>                          (no description available)
un  linux-image-unsigned-4.15.0-33-generic                <none>                          <none>                          (no description available)
rc  linux-modules-4.15.0-20-generic                       4.15.0-20.21                    amd64                           Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-modules-4.15.0-30-generic                       4.15.0-30.32                    amd64                           Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-modules-4.15.0-32-generic                       4.15.0-32.35                    amd64                           Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-modules-4.15.0-33-generic                       4.15.0-33.36                    amd64                           Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
rc  linux-modules-extra-4.15.0-20-generic                 4.15.0-20.21                    amd64                           Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-modules-extra-4.15.0-33-generic

社区高分解答

原帖链接 · NotoriousPyro · CC BY-SA 4.0

You can safely remove the corresponding version of packages to the version of the kernel that you removed. In your example because you are missing the corresponding kernel versions for the following, so you can ask your package manager to also remove:

linux-headers-4.15.0-30
linux-headers-4.15.0-30-generic
linux-modules-4.15.0-30-generic
linux-headers-4.15.0-32
linux-headers-4.15.0-32-generic
linux-modules-4.15.0-32-generic

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-08-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。