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

After upgrading to 12.10, apt commands are failing. I think emacsen-common is causing the problem. How to I proceed?

user@ubuntu:[~]$ sudo apt-get autoremove 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
The following packages will be REMOVED
  compiz-plugins-main g++-4.6 gcc-4.6-base:i386 gcj-4.6-base gcj-4.6-jre-lib gir1.2-folks-0.6
  gir1.2-gee-1.0 jockey-common libbabl-0.0-0 libcelt0-0 libcommons-el-java libelf1:i386
  libgcj12 libgegl-0.0-0 libgomp1:i386 libgsoap1 libjasper-java libjetty-java libllvm3.0:i386
  libservlet2.4-java libslf4j-java libstdc++6-4.6-dev libtiff4:i386 libx264-120 libxfce4util4
  nvidia-common packagekit-backend-aptcc python-central python-gmenu
The following packages will be upgraded:
1 upgraded, 0 newly installed, 30 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/17.3 kB of archives.
After this operation, 125 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 482449 files and directories currently installed.)
Preparing to replace emacsen-common 1.4.22ubuntu1 (using .../emacsen-common_2.0.3_all.deb) ...
/var/lib/dpkg/info/emacsen-common.prerm: 10: /var/lib/dpkg/info/emacsen-common.prerm: /usr/lib/emacsen-common/emacs-package-remove: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/ 5: /var/lib/dpkg/ /usr/lib/emacsen-common/emacs-package-remove: not found
dpkg: error processing /var/cache/apt/archives/emacsen-common_2.0.3_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/emacsen-common.postinst: 40: /var/lib/dpkg/info/emacsen-common.postinst: /usr/lib/emacsen-common/emacs-package-install: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
What did you do before this tragedy happened. It seems apt is trying to remove some core applications – Anwar Shah Nov 1 '12 at 16:59

I'm not sure if this is the wisest way to deal with this but this should work (run the following as root):

rm -rf /var/lib/dpkg/info/emacsen-*
rm -rf /var/cache/apt/archives/emacsen-*
apt-get upgrade
apt-get autoremove
share|improve this answer
Please review your answer, research if needed but be accurate when placing your answer. – Ringtail Nov 4 '12 at 15:48

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.