I found on my server (ubuntu 16.04) that there is almost no free space and it requires to be cleaned up. I started to find out which directory or path has taken more space and I can clean them up. After finishing it up, an issue was occurred and I got error while running some console command. For example when I run php -v I get this error:
(19903): Fatal Error Unable to create lock file: Bad file descriptor (9)
I cannot also run apt-get update.
How can I recover the server at this point?