sudo dpkg --configure -a This forces dpkg to reconfigure all unpacked but unconfigured packages. If you see lock-related errors, remove stale lock files:
sudo dpkg --configure -a After reconfiguration, fix any remaining broken dependencies: dpkg was interrupted ubuntu
sudo apt --fix-broken install Refresh the package index to ensure consistency: sudo dpkg --configure -a This forces dpkg to
sudo apt update Upgrade all packages to complete any pending operations: dpkg was interrupted ubuntu