I'm using Ubuntu 16.04 LTS on a 250 g4 Hp laptop, the OS runs perfectly when the charger isn't plugged in, once i connect the charger to the laptop, it shuts down. The same thing even happened when i was installing it several times until i removed the charger. Should i try another distribution or it's my laptop?
Update: i tried different distributions like mint, fedora and all of them seem to have the same problem.
I'm using dual boot with windows 10 and the charger works fine.
71 Answer
This works for my Dell Inspiron running Ubuntu, which has the same problem you described: Close the laptop, plug in the adapter, wait a few seconds, reopen the lid. You're presented with the locked screen.
Perhaps this isn't a "solution" because the laptop shouldn't reboot on plugging in the power. But it may be a helpful workaround.
1