I have installed two kernel version 3.10.48 and 3.17.6 for project. As I am not requiring 3.10.48 any more, I wanted to remove that version as it is taking up almost 10GB of my disk space. How should I go about it?
Asked
Active
Viewed 273 times
2 Answers
-1
First boot the Kernel which you want to retain. Then use the below command to remove Kernel from your machine permanently,
sudo apt-get remove --purge $(dpkg -l 'linux-image-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')
Hope this helps.
BDRSuite
- 3,196
- 1
- 13
- 11
-1
I think the 10Gb is for compiling you can clean it just by : 1. you should open the directory where you compile the source of kernel: example: cd /usr/src/linux after that use his command to clean all files genarated in the compiling process:
make clean
or in the case that you compile the kernel with make-kpkg you should clean it by:
make-kpkg clean
or you should try one of those processes :
1. For uninstalling the kernel run:
sudo apt-get remove linux-image-version_number*
sudo apt-get remove linux-headers-version_number*
sudo apt-get remove linux-image-extra-version_number* (if applicable)
or simply uninstall them from synaptic/software center.
2. For uninstalling the kernel installed from source, run:
sudo rm -rf /lib/modules/kernel_version
sudo rm -f /boot/vmlinuz-kernel_version*
sudo rm -f /boot/initrd.img-kernel_version*
sudo rm -f /boot/config-kernel_version*
sudo rm -f /boot/System.map-kernel_version*
Finally, after uninstalling the kernel by either one of the processes above, run:
sudo update-grub
to clean the grub menu.