One way to safely free space in the /boot
folder that works for every derivative of Ubuntu is the following:
Open the Terminal application and type uname -r
to get the current version of the kernel used by your system.
Get a list of all the installed kernel by typing
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e uname -r | cut -f1,2 -d"-"
| grep -e '[0-9]'
For ones who'd like to know how that works. There's a similar answer on AskUbuntu from which I've taken the information; kudos to Kultom, who linked it in a comment.
- Once you've checked that your current version of the kernel doesn't appear in the list, merge the previous command with
sudo apt-get -y purge
to remove all the old kernels. Thus, you will finally have to type
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e uname -r | cut -f1,2 -d"-"
| grep -e '[0-9]' | xargs sudo apt-get -y purge
It worked well for me and many users gave positive feedback on this procedure. It is not strictly "elementary-backed", but it works.