Ubuntu – How to autoclean the gnome main menu

cleanupgnome

I like to experiment with lots of different software in my Ubuntu install. Then, every time Ubuntu reaches a new release cycle, I simply do a clean install (instead of upgrading) to get rid of all the extra software (and their respective config files/folders). The only thing I always backup and carry to the next install (besides personal files) are the config files for gnome, so my desktop is always the way I like it. =)

The problem with that, is that the different packages I test out never get properly uninstalled, so my gnome main menu is full of broken links referring to software I had in previous installations (which got carried over because I kept the gnome config files).

Is there any automated way to go through my gnome main menu and remove any broken links? I know how to manually edit the menu, and I could go through it myself, but I'm looking for some script or package that will clean for me so I wouldn't have to do it manually every release cycle.

Best Answer

Well, I found this script

export PACKAGES=$(dpkg -l | awk '{if ($1 == "rc") print $2" "}' | tr -d '\n') [ -n "$PACKAGES" ] && sudo apt-get purge $PACKAGES

on ubuntuforums.org that shall purge the removed installations. So maybe it could work also for purging menu.