Listar los kernels instalados:
# dpkg --list | grep linux-image
Listar el kernel usado actualmente:
root@svn:~# uname -r 4.4.0-66-generic
Limpiar Kernels antiguos:
root@svn:~# sudo apt-get remove --purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d') Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: linux-headers-4.4.0-57* linux-headers-4.4.0-57-generic* linux-headers-4.4.0-59* [...]
Asegurarse que no nos vamos a cepillar el Kernel actual, y podemos tirar para delante…
After this operation, 1,483 MB disk space will be freed. Do you want to continue? [Y/n] [...]