How to remove old kernels

From Paldo

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:04, 22 November 2011 (edit)
Subgoo (Talk | contribs)
m (Easier way to remove old kernels)
← Previous diff
Current revision (05:14, 27 November 2011) (edit) (undo)
Subgoo (Talk | contribs)
m (Check menu.lst)
Line 43: Line 43:
sudo gedit /boot/grub/menu.backup sudo gedit /boot/grub/menu.backup
-Remove not longer needed kernel lines and save it as menu.lst+Remove no longer needed kernel lines and save it as menu.lst
== Sample Grub entry == == Sample Grub entry ==

Current revision

Trick by Philip Miller


[edit] Backup menu.lst

First you have to backup the menu.lst. For that open a terminal and enter the following code:

   sudo cp /boot/grub/menu.lst /boot/grub/menu.backup

[edit] Removing old kernels

Then enter the following code into the terminal:

Attention: Replace KERNELVERSION by the version of your old kernel you want to remove. Keep the stars in the line!!!


     ls /var/lib/upkg/packages/*KERNELVERSION-p*x86 | sed 's\/var/lib/upkg/packages/\sudo upkg-remove --force --verbose \g'


     ls /var/lib/upkg/packages/*KERNELVERSION-p*x86_64 | sed 's\/var/lib/upkg/packages/\sudo upkg-remove --force --verbose \g'

Copy/Paste the outputted code if you want to remove the packages.


     sudo upkg-remove --force --verbose gspcav1-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose linux-2.6-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose lirc-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose madwifi-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose ndiswrapper-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose nvidia-glx-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose nvidia-glx-71xx-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose nvidia-glx-96xx-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose uvcvideo-2.6.24-paldo1-x86
     sudo upkg-remove --force --verbose VirtualBox-2.6.24-paldo1-x86

[edit] Check menu.lst

If you remove the first kernel ever installed on your paldo-system the menu.lst gets blanked out. Open the saved backup with:

   sudo gedit /boot/grub/menu.backup

Remove no longer needed kernel lines and save it as menu.lst

[edit] Sample Grub entry

If you didn't saved your menu.lst file, here is a sample menu.lst entry:

   title paldo testing (linux
   kernel /boot/linux- root=/dev/sda9 resume=/dev/sda2 vga=0x317
   initrd /boot/initramfs-

[edit] Easier way to remove old kernels

Open a terminal and enter this code:

  sudo rm -v /var/lib/upkg/packages/*-3.1.*paldo*.select
  sudo upkg-upgrade

First all old kernel modules are marked for deinstallation except the one currently running. Via the upgrade all old kernel modules are deinstalled.

Personal tools