Yup, that'll work. To remove all associated config files too, use the --purge option. Make sure you've installed kdm as well, otherwise you're still stuck with gdm. (Confusing? Nope: Gnome is the desktop, gdm is the desktop manager that accompanies it. Likewise with KDE and kdm
)