Debian / Ubuntu apt-get stuff

home | blog | Teh Internet | guest blog |rants | placeholder | political | projects | Gwen and Liam | Citadel patched | Tools | Scouts

- Careful Chrome users, this search box might be "Not secure"

I forget how to do things (including how to search), sometimes:

/boot is full with unused kernels?
apt-get install -f   # cleans the pipes, and gives you a list of work...
* might want to do this next one first if /boot is totally full ->
apt-get autoremove   # does the work.

If desperate, check the installed kernel version with:
uname -a

And remove the ones between that version and the latest:
dpkg -l | grep linux-image
And pick off the unused kernels:
dpkg --purge linux-image-3.111.44-99-server

More that I found on ServerFault at one point, but can't find again to give attribution:
kernelver=$(uname -r | sed -r 's/-[a-z]+//')
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver

And after you figure out what you are running vs not:
uname -a

If you are not using the latest kernel, you might want to reboot to swap to the latest kernel and verify you are good
to go before purging the other kernels!

# this next one will nuke the extra kernels but might make you un-bootable
# so be careful.
#apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")

How to do a release version upgrade:
apt-get update
apt-get install update-manager-core