Kernel/Removal/zh-cn

这篇文章描述如何移除旧的kernel.

移除内核源代码
在安装新的内核并正常工作之后，旧的内核就可以移除了. emerge的"--depclean"选项（缩写为"-c"）可以用来移除所有旧的或者不用的软件版本，例如.

请确定不要移除正在运行的内核（关于如何升级请参考文章内核升级）.

保护内核源代码不被删除
在安装了新的内核文件之后，如果在切换到新的内核之前你运行了"--depclean"的话，当前的内核源文件会被移除. 如果你想保留当前的内核，移除并不是你想要的，因为你也许会需要这些源文件，例如升级外部的内核模块. 因此将指定版本的内核加入到你的world文件中以保护其不被"--depclean"操作删除是个好习惯.

注意slot符号，使用分号而不是破折号. 每个内核版本有自己的slot.

Using eclean-kernel
is a simple tool for old kernel cleanup/removal. It removes both built kernel files and build directories if they're no longer reference by any preserved kernel.

For example, to keep three newest kernels around:

Manual removal
Portage however only removes the files it installed - the files generated during the kernel build and installation remain. They can be safely removed.


 * When a kernel is built in the source directory, files generated during the build process remain, and are not removed by Portage:




 * During kernel setup, the kernel modules are copied to a sub directory of /lib/modules/:




 * The old files in can also be removed:




 * Lastly, remove all leftover entries from your bootloader's config file.