Cara Menghapus Kernel Lama di Grub Ubuntu

Ada dua cara untuk menghapus kernel lama di grub ubuntu (se-tahu saya :D):

1. Via Synaptic Package Manager
Akses Synaptic Manager:
System --> Administration --> Synaptic Package Manager
Search dengan keyword 'kernel', lalu hapus kernel lama yg anda inginkan. Tapi, penting untuk diingat!, jangan salah hapus kernel yang sedang anda gunakan.. hehehe..

Untuk mengetahui kernel yang sedang digunakan, ketikkan perintah:
# uname -a 

Contoh:

root@spydeeyk-r00m:~# uname -a
Linux spydeeyk-r00m 2.6.32-30-generic #59-Ubuntu SMP Tue Mar 1 21:30:21 UTC 2011 i686 GNU/Linux

Nah, pada contoh diatas kernel yang saya gunakan 2.6.32-30-generic.


Oh ya, setelah kernel lama dihapus alias diremove via synaptic package manager lakukan pula perintah:
# update-grub2

2. Via Command Terminal
Pertama kita cari tahu dahulu kernel-kernel yang terinstall di system kita dengan perintah:
root@spydeeyk-r00m:~# aptitude search linux-image-2.6 | grep "i "


Contoh:

root@spydeeyk-r00m:~# aptitude search linux-image-2.6 | grep "i "
i   linux-image-2.6.32-21-generic   - Linux kernel image for version 2.6.32 on x
i   linux-image-2.6.32-22-generic   - Linux kernel image for version 2.6.32 on x
i   linux-image-2.6.32-24-generic   - Linux kernel image for version 2.6.32 on x
i   linux-image-2.6.32-29-generic   - Linux kernel image for version 2.6.32 on x
i   linux-image-2.6.32-30-generic   - Linux kernel image for version 2.6.32 on x

Setelah mengetahui kernel-kernel yang terinstall, sekarang kita bisa remove kernel yang kita inginkan (ingat jangan remove kernel yang sedang dipakai, ok? :D )

Contoh:
root@spydeeyk-r00m:~# aptitude purge linux-image-2.6.32-21-generic 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
The following packages will be REMOVED:
  linux-image-2.6.32-21-generic{p} 
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 96.9MB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 311174 files and directories currently installed.)
Removing linux-image-2.6.32-21-generic ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 2.6.32-21-generic /boot/vmlinuz-2.6.32-21-generic
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-30-generic
Found initrd image: /boot/initrd.img-2.6.32-30-generic
Found linux image: /boot/vmlinuz-2.6.32-29-generic
Found initrd image: /boot/initrd.img-2.6.32-29-generic
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found linux image: /boot/vmlinuz-2.6.32-22-generic
Found initrd image: /boot/initrd.img-2.6.32-22-generic
Found Windows 7 (loader) on /dev/sda1
done
Purging configuration files for linux-image-2.6.32-21-generic ...
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-30-generic
Found initrd image: /boot/initrd.img-2.6.32-30-generic
Found linux image: /boot/vmlinuz-2.6.32-29-generic
Found initrd image: /boot/initrd.img-2.6.32-29-generic
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found linux image: /boot/vmlinuz-2.6.32-22-generic
Found initrd image: /boot/initrd.img-2.6.32-22-generic
Found Windows 7 (loader) on /dev/sda1
done
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
Writing extended state information... Done

root@spydeeyk-r00m:~#

That's it.. :)

Bagi saya ada baiknya disisakan 2 kernel.. kernel yang sedang dipakai dan sebelumnya, buat jaga-jaga aja.. :D

0 comments:

Post a Comment