Kernel/Removal/ja

この記事は、古いカーネルの削除について説明しています.

カーネルのソースの削除
新たなカーネルをインストール後、それが満足に動作しているときには、古いカーネルを削除してもかまいません. 古いカーネルのソースを削除するには emerge の --depclean オプション（-cに省略可能）を使用し、導入済パッケージ（例えば ）のすべてのバージョンまたは不要なバージョンを削除することができます.

Be sure to verify that it is not removing the sources for the currently running kernel. (See kernel upgrade article on how to upgrade.)

Protecting kernel sources
If newer kernel sources has been merged and you run --depclean before switching to the newer sources, the current sources will be removed. But if you want to stay with the current sources, this removal is not wanted, because you may need the sources e.g. for updating external kernel modules. It's therefore good practice to add the specific kernel version to your world file to protect it from --depclean operations.

Note the slot notation, using a colon instead of a dash. Every kernel version is its own 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.