Warning
Use a sudo-capable account, keep shell history for audit, and back up critical paths before changing boot, SSH, or package state.
What you will achieve
Unbreak apt when installs stop mid-way — standard Debian-family recovery.
1) Finish interrupted package operations
sudo dpkg --configure -a
sudo apt --fix-broken install
2) Refresh package metadata
sudo apt clean
sudo apt update
3) Detect held packages
apt-mark showhold