Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First of all, I am really sorry about behaving like an over smart. But hope you will be able to help me under the circumstance I am right now.

I was having some difficulty with emacs in my Ubuntu 12.04.2 installation. So I decided to reinstall everything from scratch. The steps I took are,

sudo apt-get autoremove emacs24
cd /usr/share
sudo rm -r emacs
sudo rm -r emacs24

Now whenever I try to install emacs, it tells me it can't find ispell,flyspell and debian-ispell and installation not completed, dpkg error. What can I do to fix it?

(Reading database ... 292802 files and directories currently installed.)
Unpacking emacs (from .../emacs_24.1+1-2~ppa1~precise1_all.deb) ...
Setting up emacs23 (23.3+1-1ubuntu9.1) ...
emacs-install emacs23

edit: This is the output i get, if anyone is interested

install/dictionaries-common: Byte-compiling for emacsen flavour emacs23
>>Error occurred processing debian-ispell.el: File error (("Opening input file" "no such file or directory" "/usr/share/emacs23/site-lisp/dictionaries-common/debian-ispell.el"))
>>Error occurred processing ispell.el: File error (("Opening input file" "no such file or directory" "/usr/share/emacs23/site-lisp/dictionaries-common/ispell.el"))
>>Error occurred processing flyspell.el: File error (("Opening input file" "no such file or directory" "/usr/share/emacs23/site-lisp/dictionaries-common/flyspell.el"))
emacs-install: /usr/lib/emacsen-common/packages/install/dictionaries-common emacs23 failed at /usr/lib/emacsen-common/emacs-install line 28, <TSORT> line 4.
dpkg: error processing emacs23 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of emacs:
 emacs depends on emacs23 | emacs23-lucid | emacs23-nox; however:
  Package emacs23 is not configured yet.
  Package emacs23-lucid which provides emacs23 is not installed.
  Package emacs23-lucid is not installed.
  Package emacs23-nox is not installed.
dpkg: error processing emacs (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
Try sudo apt-get upgrade && sudo apt-get update before re-installing. Also take a look at this question, it might help. – Mitch May 14 '13 at 10:24
up vote 1 down vote accepted

The solution to the problem was absolutely non-trivial. The first thing I did, was installing dictionaries-common package, because that's what causing initial problem.

sudo apt-get --reinstall dictionaries-common

After that I just tackled one problem after other. I collected problematic files manually and put them where asked and that's what solved my problem. One big lesson to learn from here is to never mess with system files under any circumstances.

share|improve this answer
the command should be sudo apt-get install --reinstall dictionaries-common – Steen Jan 29 '14 at 14:31

To download all the dependencies, use:

sudo apt-get install build-essential
sudo apt-get build-dep emacs

I've installed emacs24, if this will work for you:

sudo apt-get install emacs24

share|improve this answer
it solved somewhat, but those files are not yet available – rafee May 14 '13 at 11:17

Try: sudo apt-get purge emacs24 then sudo apt-get install -f emacs24

share|improve this answer
did not help :( – rafee May 14 '13 at 10:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.