If you can intercept boot ( press a key to get to the grub menu or whatever… I haven’t used Ubuntu in a while so maybe it’s not so simple anymore) you may be able to enter rescue / single-user mode and let apt complete the changes and then revert them.
A clean reinstall may be easier depending on how much you’ve changed on the system. Easier isn’t always better, fix this and you’ll know how to do it again in the future.