Blog Archives

Script for Removing Old Kernels and Linux Headers

This oneliner removes all the unused kernels and headers, on Ubuntu, Linux Mint, Knoppix or Debian Systems. $ dpkg -l ‘linux-*’ | sed ‘/^ii/!d;/'”$(uname -r | sed “s/\(.*\)-\([^0-9]\+\)/\1/”)”‘/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d’ | xargs sudo apt-get -y purge If

Tagged with: , , , , , , ,
Posted in The Linux and Unix Articles!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!