Most of the time this could be caused by an automatic system update running in the background. Normally you do not need to do anything just wait.
To disable the automatic updates hence to avoid the error message edit the /etc/apt/apt.conf.d/20auto-upgrades and change it:
Another situation when this error can occur is when some other process or user is using apt tool to install, update or remove packages. In that case you can attempt to see which process is holding lock on /var/lib/dpkg/lock file by using:
$ sudo lsof /var/lib/dpkg/lock
$ ps -ax | grep -E 'apt|dpkg'
Hope this helps…