User Tools

Site Tools


ubuntu_remove_all_kernels_except_current

Remove all Kernels except the one currently running

   sudo apt-get remove --purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')
ubuntu_remove_all_kernels_except_current.txt · Last modified: 2017/03/22 23:19 (external edit)