1 Way to FREE up Space on Ubuntu

Run following command to list all the images and headers except the current image and header.

dpkg -l linux-{image,headers}-“[0-9]*” | awk ‘/^ii/{ print $2}’ | grep -v -e `uname -r | cut -f1,2 -d”-“` | grep -e ‘[0-9]’

You can remove listed items by running following commands. (NOTE : Only include above listed versions)

Eg :

sudo apt-get remove linux-image-3.13.0-{34,35,39}-generic

sudo apt-get remove linux-headers-3.13.0-{34,35,39}-generic

sudo apt-get remove linux-headers-3.13.0-{34,35,39}

Remove dependencies.

sudo apt-get autoremove

Dont’ forget to update grub

sudo update-grub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s