In Ubuntu, you may sometimes encounter an error when attempting to run an apt command:
- Access to a terminal window/command line
- A user account with sudo or root privileges
- Verify apt and/or dpkg isn’t running. It’s still running; then, you should wait for the process to finish.
- If the process is stuck using the following.
- Remove the lock file.