If configuring dpkg doesn’t work, and you get the same error again and again, execute
$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ cd /var/lib/dpkg/updates
$ sudo rm *
$ sudo apt-get update
These commands generall are a permanent fix.