I'm running Ubuntu 17.10 on VM.
In the guest I opened GNOME terminal, launched Aptitude with
sudo aptitude, then switched to the host machine to do some tasks.
When I returned to the Ubuntu guest it was showing this notification on lock screen:
1 new notification
and after unlocking:
Computer will suspend very soon because of inactivity.
Just after unlocking Aptitude says that it can't download packages because the system is offline.
How can I disable this behavior?