-1

my last update failed because /boot did not have room for the new kernel (or so I guess). Can I safely use rm to blow away the old vmlinuz.*-generic?

Thanks

  • 1
    can you say what kind of distro you are using, anyway, use the package manager, i think you are using apt – c4f4t0r Aug 17 '14 at 20:42

2 Answers2

3

No, you should use your operating specific way of removing old versions of the Linux kernel. (yum for RHEL based like CentOS or Fedora, apt-get for Debian based like Ubuntu and so on)

Florin Asăvoaie
  • 7,057
  • 23
  • 35
  • On Ubuntu (and possibly Debian) the command to use would usually be `apt-get autoremove`. I don't remember the `yum` equivalent. – kasperd Aug 17 '14 at 20:49
  • autoremove will remove dependencies installed for purged packages. It will not remove old kernels. – Florin Asăvoaie Aug 17 '14 at 20:52
  • Not sure which system you are referring to. On Ubuntu 14.04 `apt-get autoremove` does remove older kernels, and it is not the first Ubuntu release working like that. – kasperd Aug 17 '14 at 21:13
  • Ok, after a little bit of research, you are right, with one glitch: by default the Kernel image is present in /etc/apt/apt.conf.d/01autoremove in the neverautoremove area so what you are saying will not work exactly as expected all the time. Also, autoremove would probably remove ALL older versions of kernels. You may want to keep at least the previous one, just in case. – Florin Asăvoaie Aug 18 '14 at 06:01
  • I only see firmwares in that section, not the kernels themselves. Keeping one known to be working kernel installed is always a good idea. – kasperd Aug 18 '14 at 06:44
1

It's always good to leave at least 1-2 old kernels available in case the new one shows some regressions.

On Fedora/RHEL/CentOS, install the yum-utils package and run the following command package-cleanup --oldkernels --count=1 to clean old kernels before upgrading.

Never rm system components previously managed by RPM/DKPG, unless you know what you're doing.

gtirloni
  • 5,746
  • 3
  • 25
  • 52