No. It simply completes pending configuration tasks. It does not delete user files. However, if a package’s post-installation script has a bug, it might fail again—but that won’t delete your data.
If the error reappears, or if sudo dpkg --configure -a itself fails, you'll need to go deeper. Read on.
If the standard command throws a new error saying it "could not get lock," it means a ghost process from the initial crash is still holding onto the database lock files. You must clear these locks before dpkg can do its job. However, if a package’s post-installation script has a
Avoid opening Software Center, Synaptic, or another terminal with apt while one is already running. Check for active locks:
sudo rm /var/lib/dpkg/lock sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/cache/apt/archives/lock Use code with caution. After deleting the locks, re-run the configuration fix: sudo dpkg --configure -a Use code with caution. If the standard command throws a new error
You should see the system pick up where it left off. It might take a few minutes. If this runs successfully without errors, you can now run your update command ( sudo apt update ) and everything should work.
(Replace [PID_NUMBER] with the actual number from the previous command). which is also in package baz
dpkg: error processing package foo (--configure): trying to overwrite '/usr/bin/bar', which is also in package baz