User Tools

Site Tools


old_kernel_cleanup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

old_kernel_cleanup [2026/02/27 23:09] – created tomekold_kernel_cleanup [2026/02/27 23:16] (current) tomek
Line 1: Line 1:
 ====== Old Kernel Cleaup ====== ====== Old Kernel Cleaup ======
 +[[https://www.youtube.com/watch?v=uCR_CdNCVlQ]]
  
 +===== Bakup GRUB and initrd =====
 +<code>
 +cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
 +cp /boot/initrd.gz /boot/initrd.gz.bak
 +</code>
 +
 +===== Removing old kernel packages =====
 +<code>
 +// First list packages to delete //
 +ls /var/log/packages/kernel-*-5.15.193*
 +
 +// Then run removepkg command //
 +removepkg /var/log/packages/kernel-huge-5.15.193-x86_64-1
 +removepkg /var/log/packages/kernel-generic-5.15.193-x86_64-1
 +removepkg /var/log/packages/kernel-modules-5.15.193-x86_64-1
 +removepkg /var/log/packages/kernel-source-5.15.193-noarch-1
 +</code>
 +
 +//Do not remove kernel headers because if we'll remove kernel-headers by removepkg command we delete key system directories f.e. for script compiling so system would start but we wouldn't be able to compile any package, even simple console program//
 +
 +Then check does removepkg command cleaned all old kernel symlinks and folders. If not delete them manually:
 +<code>
 +cd /boot
 +rm -f config-generic-5.15.193.x64 config-huge-5.15.193.x64
 +rm -f System.map-generic-5.15.193 System.map-huge-5.15.193
 +rm -f vmlinuz-generic-5.15.193 vmlinuz-huge-5.15.193
 +rm -rf /usr/src/linux-5.15.193
 +</code>
 +
 +===== Setting up new main kernel =====
 +<code>
 +cd /boot
 +ln -sf vmlinuz-6.18.8 vmlinuz
 +ln -sf System.map-6.18.8 System.map
 +ln -sf .config-6.18.8 config
 +</code>
 +
 +===== Generate new GRUB config =====
 +<code>
 +grub-mkconfig -o /boot/grub/grub.cfg
 +</code>
old_kernel_cleanup.1772233752.txt.gz · Last modified: by tomek

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki