I think there is a problem with the cache memory try restarting the Ubuntu server and type the command correctly with proper space and hyphen wherever required
Hope this helps.
i tried restarting the ubuntu server and also my system and again the same line is repeating over and over again.
If the problem persists I think reinstallation of Ubuntu server in VMware could fix this problem
Can you run the below queries one after the other and share the output here?
sudo lsof /var/lib/dpkg/lock sudo lsof /var/lib/apt/lists/lock` sudo lsof /var/cache/apt/archives/lock