This is NOT Android fault.
Get a Nexus phone, Android One phone or any other that is on fast track of updates. They are first ones to receive latest updates and they stay updated for ~2 years.
Poor G900F is still stuck on 5.0, shame on Samsung!. Even budget phones are doing well in updates than Samsung.