A dropped SSH connection or an impatient Ctrl-c in the middle of apt upgrade can leave packages half done. apt notices, and from then on every apt command stops with this message:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
It’s one of the few error messages that tells you the fix, and the fix is fine to run:
sudo dpkg --configure -a
When apt installs a package, dpkg first unpacks the files and then configures the package: it puts the config files in place and runs the package’s setup script. If the run stops between those two steps, the package stays unpacked but not configured. --configure with -a (long form --pending) picks up every package in that state and finishes the job.
Afterwards I’d let apt check the dependencies and then run the upgrade again, so the packages that never got their turn are done as well:
sudo apt --fix-broken install
sudo apt upgrade
Two caveats. If the original cause is still there, for example a disk that is still full, the configure step fails the same way, so check df -h first. And don’t go deleting the lock files in /var/lib/dpkg to get past an error: a lock usually means another apt or unattended-upgrades run is still busy, and two of them at once is how you get the mess in the first place. If you want to see what dpkg itself thinks is wrong, sudo dpkg --audit lists the packages that are only partly installed.
Further reading: dpkg manual page (Ubuntu), apt-get manual page (Ubuntu)