Here's the third patch again with all the changes requested by John integrated (and the subject line corrected). This is now fully tested (I hope I didn't forget anything). Additionally I have arranged that packages in categories "Base" and "Misc" can not be deleted, an attempt to do so will re-install them.