Como a mensagem de erro diz:
sudo dpkg --configure -a
de man dpkg
--configure package...|-a|--pending
Configure a package which has been unpacked but not yet
configured. If -a or --pending is given instead of package, all
unpacked but unconfigured packages are configured.
To reconfigure a package which has already been configured, try
the dpkg-reconfigure(8) command instead.
Configuring consists of the following steps:
1. Unpack the conffiles, and at the same time back up the old
conffiles, so that they can be restored if something goes wrong.
2. Run postinst script, if provided by the package.