This is quite complicated, and there isn't an easy/quick way to do this. The best approach is to completely remove unity, install gnome3, then upgrade:
sudo apt-get purge unity unity-2d unity-2d-panel unity-2d-spread unity-asset-pool unity-services unity-lens-files unity-lens-music unity-lens-applications gir1.2-unity-5.0 unity-common indicator-sound indicator-power indicator-appmenu libindicator7 indicator-application indicator-datetime indicator-messages libnux-2.0-0 nux-tools libunity-misc4 unity-2d-common lightdm
sudo apt-get install ubuntu-gnome-desktop ubuntu-gnome-default-settings
sudo apt-get autoremove
sudo do-release-upgrade
I recommend you to do this in a text based environment, since the GUI binaries could be incomplete leaving the desktop unstable.
If you want to force unity to be uninstalled, you can put the package on hold:
echo 'unity hold' | sudo dpkg --set-selections
I'm not totally sure that do-release-upgrade
respect on hold packages, due the lack of documentation.
do-release-upgrade
. Any use ofdo-release-upgrade
except to upgrade an earlier version of Ubuntu to a later one is unsupported and likely to fail and break things badly. – Eliah Kagan Aug 16 '13 at 15:00