Are your running another package manager? This includes Ubuntu Software, Synaptic, Terminal windows running apt/aptitude/dpkg, and others. It does NOT include Snapd, Pip, Flatpack, or Appimage managers since none of those use debs. You can only run one deb package manager at a time. Close the ones you are not using.
It's possible that Unattended Upgrades is running. Here's how to check:
$ ls -la /var/lib/apt/periodic/
total 8
drwxr-xr-x 2 root root 4096 Sep 15 2017 .
drwxr-xr-x 5 root root 4096 Apr 2 19:08 ..
-rw-r--r-- 1 root root 0 Apr 2 19:06 download-upgradeable-stamp
-rw-r--r-- 1 root root 0 Apr 2 19:08 unattended-upgrades-stamp
-rw-r--r-- 1 root root 0 Apr 2 19:05 update-stamp
-rw-r--r-- 1 root root 0 Apr 2 19:05 update-success-stamp
-rw-r--r-- 1 root root 0 Apr 2 19:08 upgrade-stamp
Here you can see the entire process that Unattended Upgrades uses: update, update-success, download-upgradeable, upgrade, unattended-upgrades.
Look for that sequence of stamps, all within a few minutes of each other. If some stams are from a few minutes ago but others are from yesterday, then you know that UU is probably still running. Avoid interrupting it when possible - cleanup after an unclean shutdown can be tedious.
- After you have closed all open package managers, and you have confirmed that Unattended Upgrades seems to not be running, time to check for running processes:
$ ps -e | grep apt
(no output)
$ ps -e | grep dpkg
(no output)
$ ps -e | grep aptdaemon
(no output)
If there IS output, then you have found the package management application that is running. When possible, let it finish. If you get a stuck process (very rare), kill the process and manually release the lockfile. DO NOT poweroff your computer or hold down the power button -- doing those may damage your system.