scripts-main/rm_all_old_kernels
2018-06-21 22:49:50 -05:00

2 lines
217 B
Plaintext
Executable File

export KERNEL="$(uname -r | grep -Po '([0-9\.\-]*[0-9])?')"; dpkg --get-selections | grep -E "linux-(header|image).*" | grep -iw install | sort | grep -v "$KERNEL" | grep -v "lts" | sed 's/install//g' | xargs dpkg -P