The tail of DpkgTerminalLog.gz indicates a problem in ocaml-mode actually (see below). Reassigning.
As a workaround, try temporarily uninstalling this package - maybe it can be reinstalled after your Emacs upgrade is complete. There are many other unrelated errors in this file; maybe you'll want to audit it. Excerpt: Setting up emacs24 (24.5+1-8ubuntu2) ... Install emacsen-common for emacs24 emacsen-common: Handling install of emacsen flavor emacs24 Wrote /etc/emacs24/site-start.d/00debian-vars.elc Wrote /usr/share/emacs24/site-lisp/debian-startup.elc Install ocaml-mode for emacs24 install/ocaml-mode: Handling install for emacsen flavor emacs24 Loading 00debian-vars... Loading /etc/emacs/site-start.d/50asymptote.el (source)... Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)... Info: Skip debian-el loading if run under dpkg control. Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)... Error while loading 50latex-cjk-common: Cannot open load file: aucun fichier ou dossier de ce type, cjk-enc Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)... Loading /etc/emacs/site-start.d/50lilypond-data.el (source)... Loading /etc/emacs/site-start.d/50ocaml-mode.el (source)... Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)... Loading /etc/emacs/site-start.d/51tuareg-mode.el (source)... Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-compat.elc In toplevel form: camldebug.el:45:1:Error: Too many arguments Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml.elc Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-emacs.elc Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-font.elc Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-help.elc Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-hilit.elc Wrote /usr/share/emacs24/site-lisp/ocaml-mode/caml-types.elc In toplevel form: inf-caml.el:20:1:Error: Too many arguments ERROR: install script from ocaml-mode package failed dpkg: error processing package emacs24 (--configure): subprocess installed post-installation script returned error exit status 1 ** Package changed: emacs24 (Ubuntu) => ocaml (Ubuntu) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to emacs24 in Ubuntu. https://bugs.launchpad.net/bugs/1688771 Title: package emacs24 24.5+1-8ubuntu2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 Status in ocaml package in Ubuntu: New Bug description: package emacs24 24.5+1-8ubuntu2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 ProblemType: Package DistroRelease: Ubuntu 17.04 Package: emacs24 24.5+1-8ubuntu2 ProcVersionSignature: Ubuntu 4.10.0-20.22-generic 4.10.8 Uname: Linux 4.10.0-20-generic x86_64 ApportVersion: 2.20.4-0ubuntu4 Architecture: amd64 Date: Sat May 6 19:34:13 2017 ErrorMessage: subprocess installed post-installation script returned error exit status 1 InstallationDate: Installed on 2016-12-23 (134 days ago) InstallationMedia: Xubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2) RelatedPackageVersions: dpkg 1.18.10ubuntu2 apt 1.4 SourcePackage: emacs24 Title: package emacs24 24.5+1-8ubuntu2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 UpgradeStatus: Upgraded to zesty on 2017-05-06 (0 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ocaml/+bug/1688771/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp