[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /lib/modules/<kernel-version> directory not being removed



On 2009-08-13 21:51 +0200, Kushal Koolwal wrote:

> In a normal scenario, whenever we do:
>
> apt-get purge linux-image-
>
> the corresponding:
>
> /lib/modules/
>
> directory gets removed from the system.
>
> But I noticed that suppose installed some out-of-tree kernel modules
> and now when you try to remove the same kernel (for which you
> installed out-of-tree modules), I get the following error message:
>
> Purging configuration files for linux-image-2.6.30-1-test7 ...
> Running postrm hook script /sbin/update-grub.
> Searching for GRUB installation directory ... found: /boot/grub
> Searching for default file ... found: /boot/grub/default
> Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
> Searching for splash image ... none found, skipping ...
> Found kernel: /boot/vmlinuz-2.6.30-3-bpo50-test10
> Updating /boot/grub/menu.lst ... done
>
> rmdir: failed to remove `/lib/modules/2.6.30-1-test7': Directory not empty
> dpkg - warning: while removing linux-image-2.6.30-1-test7, directory `/lib/modules/2.6.30-1-test7' not empty so not removed.

This sounds logical, since your out-of-tree modules are probably still
there.

> In the above output I am trying to remove the kernel 2.6.30-1-test7.
>
> I know I can explicitly remove the directory but I would is there any
> configuration file which prevents removed directory which have been
> tainted by adding some additional files/modules which were not part of
> the original package?

No, there is no such configuration file.  A directory cannot be removed
unless it is empty, it is as simple as that.  Or do you mean that the
directory _is_ empty?  In that case, please show the exact command you
typed and the complete output you got.

Sven


Reply to: