I need to delete older kernels from a server to make room for updating to a new one. I can't really use GUI-based methods like synaptic
, and apt-get remove --purge
didn't work.
What to do?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI need to delete older kernels from a server to make room for updating to a new one. I can't really use GUI-based methods like synaptic
, and apt-get remove --purge
didn't work.
What to do?
Create a shell script with this content:
#!/bin/sh
dpkg -l linux-* | \
awk '/^ii/{ print $2}' | \
grep -v -e `uname -r | cut -f1,2 -d"-"` | \
grep -e '[0-9]' | xargs sudo apt-get -y purge
This script will remove old kernels, headers and sources.
This Article details for remove old kernel linux http://www.ibotme.com/knowledgebase/linux-existe-alguna-manera-de-ocultar-o-eliminar-las-versiones-anteriores-de-kernel/
Download and install either of these from software center:
Janitor
Ubuntu Tweak(it has the janitor built in it)
Open Janitor(direct janitor or tweak), you will find "Old Kernel Packages" under "System". Tick mark on it and click 'Clean'
Enter the password and the old ones will be removed