Remove Ubuntu old kernels

Support Wissensdatenbank

Du bist hier:
Print

Remove Ubuntu old kernels

Do you want to remove old kernels? Or is your /boot drive full?

Ubuntu does not remove old kernels for security reasons. To counteract this, you can remove the old kernels via SSH as follows (we do not recommend an automatic CronJob script)

dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | tee zu_entfernende_Kernel
cat zu_entfernende_Kernel | xargs sudo apt-get -y purge
rm zu_entfernende_Kernel

 

War dieser Artikel hilfreich?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
Wie können wir diesen Artikel verbessern?
Please submit the reason for your vote so that we can improve the article.
Brauchst du Hilfe?
Related Post