bagaimana mencegah ubuntu tidur saat tutup ditutup

Go to System Settings and then click on Power. In the power setting, make sure that option for 'When the lid is closed' is set to Suspend. If you had a different setting here, you should check if you are able to suspend Ubuntu by closing the lid.
Blue-eyed Batfish