3

I am trying to simply do:

sudo apt install emacs

on Ubuntu 20.04.

The result is that it appears there is an error installing emacsen-common in emacs-gtk which is ultimately a dependency of all of emacs. The error I am seeing is:

Setting up emacs-gtk (1:26.3+1-1ubuntu2) ...
Install emacsen-common for emacs
emacsen-common: Handling install of emacsen flavor emacs
emacs: error while loading shared libraries: libotf.so.0: cannot open shared object file: No such file or directory
ERROR: install script from emacsen-common package failed
dpkg: error processing package emacs-gtk (--configure):
 installed emacs-gtk package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of emacs:
 emacs depends on emacs-gtk (>= 1:26.3) | emacs-lucid (>= 1:26.3) | emacs-nox (>= 1:26.3); however:
  Package emacs-gtk is not configured yet.
  Package emacs-lucid is not installed.
  Package emacs-nox is not installed.

dpkg: error processing package 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:
 emacs-gtk
 emacs
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am hoping to get some ideas around how to fix this.

  • 1
    I ran into the same issue. No idea how to properly install emacs yet, but managed to get apt into a normal state by running sudo dpkg --remove --force-remove-reinstreq for each package with unmet dependencies. – LyteFM May 10 at 19:20
  • 1
    I managed to fix this by running sudo apt install --reinstall libotf0 libm17n-0 after purging emacs.. no idea why it works. but it does. – sanimalp May 11 at 19:43
  • Nice, that worked for me too. – LyteFM May 11 at 19:48
2

To fix this, I first did sudo apt purge emacs.

I then reinstalled libotf0 and libm17n-0, using:

sudo apt install --reinstall libotf0 libm17n-0

after that, sudo apt install emacs worked as expected.

| improve this answer | |
0

One can do it also in another way : using snap package through snap store

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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