AOSP Android 6.0 Marshmallow is now available for the Sony Xperia Z2 device. It is not free of troubles though, but if you are eager to try new things and are initiate in the magic of operating systems, you should be eager to try something experimental on your Sony device.
This first build brings about some bugs as well, including the camera not working and a defect in the video playback color calibration. The build itself comes from scstar6696, a senior dev on XDA, where you will find the complete tutorial to what you have to and what you MUST NOT do in order to get AOSP on your Xperia Z2. Happy flashing!
Source: XDA forum