I had the same error yesterday. I tried installing every emacs package in the repository, and when that didn't work, it occurred to me that maybe conflicts were the problem. Since I didn't need emacs23
if emacs-snapshot
would work, I did the following:
Uninstall All Emacs Packages
Before proceeding, have a look at what emacs packages might be installed by issuing `sudo apt-cache search emacs'. If you can sacrifice everything in the output, go ahead with the following suggestion.
sudo apt-get remove `apt-cache search emacs | awk '{print $1}'` --purge
If something else shows up in the output that you wish to keep, a quick way to get rid of the things you don't want is to redirect the output of the command to a file, edit that file, and then use the contents of that file for arguments to apt-get remove
.
sudo apt-cache search emacs > remove.txt
- Edit
remove.txt
by deleting the lines of packages you wish to keep. The goal here is to get rid of anything emacs-related, so leave those packages in the file.
sudo cat remove.txt | xargs apt-get remove --purge
You may get some errors here since emacs-snapshot failed to install correctly. If you do, try uninstalling those packages manually by first force installing the broken packages and then remove-purging them.
sudo apt-get -f install # don't list packages here
sudo apt-get remove emacs-snapshot --purge
It's probably also a good idea to autoclean
and autoremove
.
sudo apt-get autoclean
sudo apt-get autoremove
Install Emacs 24
sudo apt-get install emacs-snapshot
This assumes that you have the PPA added correctly (I'm using the cassou PPA as well). Everything seems to work nicely now!
Try aptitude
Since originally writing this answer I've moved on the using aptitude
to manage my packages on the command line. I don't like the graphical interface (ncurses) you get from issuing sudo aptitude
, so I only use it when I need to resolve dependencies/conflicts leftover from experimenting with different desktop environments. Most of the time, I simply use it as a drop-in replacement for apt-get
, as in sudo aptitude install [package]
.
Related: Is aptitude still considered superior to apt-get?
sudo apt-get install -f
?