On Thu, 19 Jan 2006 15:36:53 -0000, Michael Kintzios wrote: > Also it doesn't remove the source distpackages, or the lib/modules for > the particular kernel version. There may be a script lurking somewhere > in the forums, but I remove these manually out of habit.
Removing the source tarballs for older kernel installs may not be a good
idea, as it could be the same tarball as for the current kernel.
I clean out old kernel versions with this script, that leaves the last
two.
#!/bin/bash
# clean /lib/modules
cd /lib/modules
ls -1 | head -n -2 | xargs rm -fr
# clean /boot
mount /boot
cd /boot
ls -1 config-* | head -n -2 | while read f; do
mv $f oldconfigs/
done
ls -1 System.map-* | head -n -2 | xargs rm -f
ls -1 vmlinuz-* | head -n -2 | xargs rm -f
# clean /usr/src
cd /usr/src
ls -1d linux-* | head -n -2 | xargs rm -fr
/usr/local/bin/qpkg -d -v -nc gentoo-sources | head -n -2 | xargs emerge
--unmerge
umount /boot
--
Neil Bothwick
Headline: "Explosion At Sperm Bank, Nurses Overcome"
signature.asc
Description: PGP signature

