You have encountered the above error in Debian or Debian based GNU/Linux Distribution.
This may cause problems like:
- errors in sudo apt-get update, sudo apt-get upgrade, sudo apt-get install, and other processes.
- dpkg: error processing package
- post-installation script subprocess returned error exit status 1
- Errors were encountered while processing
- E: Sub-process /usr/bin/dpkg returned an error code (1)
Step 1. Execute command in terminal
sudo fuser -v /var/cache/debconf/config.dat
Step 2. You will get result in following format. Copy the PID from it.
USER PID ACCESS COMMAND
Step 3. Execute command. Replace PID with your actual PID. If the first command works, then the second command will give the output “No such process”
sudo kill PID or sudo kill -9 PID
Step 4. Now you will not get the error.