Clean up Ubuntu boot partition

If you find that /boot in your Ubuntu is full of you can clean up all old versions with following command:   sudo apt-get remove –purge $(dpkg -l ‘linux-*’ | sed ‘/^ii/!d;/'”$(uname -r | sed “s/\(.*\)-\([^0-9]\+\)/\1/”)”‘/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d’)   Another command may work for others:   dpkg -l linux-{image,headers}-“[0-9]*” | awk ‘/^ii/{ […]