removing old kernels from debian based linux

This one-liner removes all not running installed kernels from the system.

After couple U/K/Ebuntu updates it saves 1GB :)

apt-get remove –purge -y $(dpkg -l | grep -E “(linux-image|linux-headers)” | grep ^ii |grep -v `uname -r|cut -f1-2 -d-|tr – .` | cut -f3 -d’ ‘ )

 

 

 

Follow

Otrzymuj każdy nowy wpis na swoją skrzynkę e-mail.