Whonix Gateway stuck on upgrading

Whonix Gateway 14 is stuck after running sudo apt-get dist-upgrade. I restarted couple of times the virtual machine and then run sudo dpkg -configure -a and then it show Setting up linux-image-4.9.0.8-amd64 and that’s it. I waited more than one hour but no change. How to fix this?

Could you try please to increase VM RAM?

I increased the RAM from 256 to 1024 and the upgrade worked this time. Thanks.