Posted By

garretjames on 12/20/14


Tagged

linux Kernels


Versions (?)

Remove Old Kernel Versions


 / Published in: Bash
 

URL: http://ubuntuforums.org/showthread.php?t=1435818

Snippet found on forums to clean up /boot when too many kernels are installed. Though I think the script may need tweaking. Use at own risk!

  1. dpkg --get-selections | \
  2. grep 'linux-image*' | \
  3. awk '{print $1}' | \
  4. egrep -v "linux-image-$(uname -r)|linux-image-generic" | \
  5. while read n
  6. do
  7. apt-get -y remove $n
  8. done

Report this snippet  

You need to login to post a comment.