Got this all working according to the instructions on 16.04 (its all I had...). Worth noting you will probably want to setup SSH access as you really don't need access to the GUI anyways.
G502 is my daily use mouse, would recomend, its comfy (for me), has some weight, comes with the software (like Razer I guess) and I have never had problems, had it for over 1 year so far. (BUT I'm probably biased )