24

I have a 2G home partition, /lib/modules is taking more that 1.5G. I got 12 directory named after version of kernel 2.6.32 each taking 119k. Why do I have all of that? Do I need all of that? If not, what is the clean way to remove what I don't need?

Thanks

2

1 Answer 1

22

Automatic update is installing each new kernel, but there is no clean-up, and there is a copy of the module for each kernel.

There is a package entry called :

linux-image-<version>-generic

Removing it removed the corresponding files in /lib/modules

5
  • 11
    This is correct, but there are more complete instructions for cleanup at askubuntu.com/questions/2793/…
    – Amanda
    Apr 28, 2013 at 23:51
  • 8
    sudo apt autoremove does this for you in current Ubuntu versions. No need to manually clean the files. Jun 13, 2018 at 9:49
  • 2
    Autoremove does not work for me. But sudo apt-get purge linux-image-4.15.0-45-generic does. Apr 8, 2019 at 2:59
  • Is this safe to do ? What am i looking in here ? What are those packages ? Apr 13, 2022 at 19:26
  • somehow ubuntu can't remove /lib/modules/ dirs, even with purge. I receive the error rmdir: failed to remove '/lib/modules/5.15.0-88-generic': Directory not empty
    – nulll
    Dec 12, 2023 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .