I'd like to remove some old kernels but not sure how to proceed the right way and have Grub2 work correctly. If you could lend a hand I'd appreciate it. Thanx for any help!
Bob
Bob
sudo dpkg -l | grep ^ii | grep linux-image | awk '{ print $2 }' | sort | head -n -2 | xargs sudo apt-get -y remove
rmkernel () { local cur_kernel=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g') local kernel_pkg="linux-(image|headers|ubuntu-modules|restricted-modules)" local meta_pkg="${kernel_pkg}-(generic|i386|server|common|rt|xen|ec2)" sudo aptitude purge $(dpkg -l | egrep $kernel_pkg | egrep -v "${cur_kernel}|${meta_pkg}" | awk '{print $2}') purge_pkg }
sudo dpkg -l | grep ^ii | grep linux-image | awk '{ print $2 }' | head -n -2 | xargs sudo apt-get -y remove
| xargs sudo apt-get -y remove
sudo dpkg -l | grep ^ii | grep linux-image | awk '{ print $2 }' | sort | head -n -2
sudo dpkg -l | grep ^ii | grep linux-image | awk '{ print $2 }' | head -n -2
sudo dpkg -l | grep ^ii | grep linux-image | awk '{ print $2 }'
Comment