I just update, but, I don't want to restart the computer, 'cause it may not reboot
2 Answers
Test this:
Open a terminal,
Press Ctrl+Alt+T
Run it:
sudo -i
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
apt-get purge $OLDCONF
apt-get purge $OLDKERNELS
apt-get autoremove
apt-get clean
First get your current kernel image
uname -r
Then find out what other kernels version you have installed (and not using usually)
sudo dpkg --list 'linux-image*'
Now time to remove all the other kernel using the following command
sudo apt-get remove
Don't remove the kernel image that was shown on the first command (its the one you are using).
Finally
cross your fingers
-
Thanks, I made this mini script to list the installed kernels, and then use
sudo apt-get remove
to uninstall the older ones. dpkg --list 'linux-image*' | grep ^ii | grep -v linux-image-generic | grep -vuname -r
– cumanacrMay 30, 2015 at 7:05