Fix "Could Not Get Lock" and Broken Package Errors
Tools You'll Need
Terminalaptdpkg
1. "Could not get lock /var/lib/dpkg/lock": another update is already running, often the automatic updater. Wait a few minutes and try again. Don't delete the lock files while something is installing.
2. Install interrupted (power cut, closed terminal): run
sudo dpkg --configure -a
3. "Unmet dependencies" or broken packages:
sudo apt --fix-broken install
4. Then refresh everything:
sudo apt update
sudo apt upgrade
5. Still failing on one program? Note the package name in the error and remove it: sudo apt remove name, then try again.