List installed Proxmox kernels

List installed Proxmox kernels:

dpkg -l | cut -d" " -f3 | grep pve-kernel

List installed Proxmox kernels without currently used kernel:

dpkg -l | cut -d" " -f3 | grep pve-kernel | grep -v "$(uname -r)"

Remove unused kernels (this may remove the lastest kernel, if no reboot was done, since last kernel update):

for i in `dpkg -l | cut -d" " -f3 | grep pve-kernel | grep -v "$(uname -r)"`; do apt purge $i -y; done