create/add swap bash

Create a decent file for example 2GB with fallallocate , if not available you can use dd :

sudo fallocate -l 2G /swapfile

or

sudo dd if=/dev/zero of=/swapfile bs=1024 count=2097152

Add the created

sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

this can solve the problem of the apt | apt-get output :
APT FATAL -> Failed to fork
that can be a result of no more memory to allocate