I am trying to install Emacs 24 on Ubuntu 12.04 from the PPA as follows
sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
My system is already running Emacs 23.3.1 from the default repositories. The install runs normally before erroring out with the following message.
install/ilisp: Handling install for emacsen flavor emacs24
emacs-install: /usr/lib/emacsen-common/packages/install/ilisp emacs24 emacs23 failed at /usr/lib/emacsen-common/emacs-install line 28, <TSORT> line 20.
dpkg: error processing emacs24 (--configure):
subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
emacs24
E: Sub-process /usr/bin/dpkg returned an error code (1)
I came across this thread which also discusses a broken Emacs 24 installation but their problem was of missing files, which mine does not seem to be. I have also made sure that the dependencies are there by running
sudo apt-get install build-essential
sudo apt-get build-dep emacs
This thread from last year about 11.10 recommends removing all of emacs first but that sounds pretty extreme, and as one commenter there pointed out, purging emacs from 12.04 may remove some Ubuntu components as well. I am hoping there are some better solutions out there by now.