I could not install nginx by using the provided command. I got the following error:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3345 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
I managed to solve it by following the instructions in this post ([Solved] Could not get lock /var/lib/dpkg/lock Error in Ubuntu )
Using both method 1 and 2 mentioned in the post.
Any better way to handle this?