gdm not working with Ubuntu 15.10

I finally got gdm to work properly. Initially I had just installed gnome-shell, which allowed me to use the GNOME desktop environment, but didn't allow me to use gdm with it, as described above, which causes certain other problems, like being unable to lock for example, and other issues mentioned in the comments to the question.

The solution was to install ubuntu-gnome-desktop:

sudo apt-get install ubuntu-gnome-desktop

After that, I changed my display manager back to gdm with:

sudo dpkg-reconfigure gdm

and after restarting I was greeted with the appropriate login screen, and everything has worked smoothly so far.

I am assuming this fix worked because of either some extra dependencies that were needed, or some extra tweaks that were made to configuration files when installing that package. I don't have quite enough experience with LInux yet to understand why this worked, but it did, and hopefully it will too for others that have had this problem.

Update:

I cannot confirm whether this works or not because I have not tried it, but user @detly suggests in the comments below that 17.04 users should use gdm3 instead of gdm. Just wanted to highlight this just in case it is useful for users of later versions of Ubuntu.