My emacs is broken and I cannot repair it. I want to reinstall emacs 26.3 from the official linux mint repositories -- not snap or other 3rd party repo, as those are spawning even more errors/warnings. I am on linux mint 20.3. First, I have tried to remove emacs completely. I've done so using

sudo apt-get remove emacs-bin-common emacs-common emacs-el emacs-gtk

Afterwards, and as described here, I have run this command

sudo apt-get install --reinstall dictionaries-common libotf0 libm17n-0

The problem starts afterwards, as running sudo apt-get install emacs is unsuccessful. Similar errors show up if I try emacs-lucid or emacs-nox.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  emacs-bin-common emacs-common emacs-el emacs-gtk
Suggested packages:
  mailutils emacs-common-non-dfsg
The following NEW packages will be installed
  emacs emacs-bin-common emacs-common emacs-el emacs-gtk
0 to upgrade, 5 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/32.9 MB of archives.
After this operation, 128 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Selecting previously unselected package emacs-common.
(Reading database ... 421093 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs-common (1:26.3+1-1ubuntu2) ...
Selecting previously unselected package emacs-bin-common.
Preparing to unpack .../emacs-bin-common_1%3a26.3+1-1ubuntu2_amd64.deb ...
Unpacking emacs-bin-common (1:26.3+1-1ubuntu2) ...
Selecting previously unselected package emacs-gtk.
Preparing to unpack .../emacs-gtk_1%3a26.3+1-1ubuntu2_amd64.deb ...
Unpacking emacs-gtk (1:26.3+1-1ubuntu2) ...
Selecting previously unselected package emacs.
Preparing to unpack .../emacs_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs (1:26.3+1-1ubuntu2) ...
Selecting previously unselected package emacs-el.
Preparing to unpack .../emacs-el_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs-el (1:26.3+1-1ubuntu2) ...
Setting up emacs-common (1:26.3+1-1ubuntu2) ...
Setting up emacs-el (1:26.3+1-1ubuntu2) ...
Setting up emacs-bin-common (1:26.3+1-1ubuntu2) ...
update-alternatives: using /usr/bin/ctags.emacs to provide /usr/bin/ctags (ctags) in auto mode
update-alternatives: using /usr/bin/ebrowse.emacs to provide /usr/bin/ebrowse (ebrowse) in auto mode
update-alternatives: using /usr/bin/emacsclient.emacs to provide /usr/bin/emacsclient (emacsclient) in auto mode
update-alternatives: using /usr/bin/etags.emacs to provide /usr/bin/etags (etags) in auto mode
Setting up emacs-gtk (1:26.3+1-1ubuntu2) ...
update-alternatives: using /usr/bin/emacs-gtk to provide /usr/bin/emacs (emacs) in auto mode
tsort: -: input contains a loop:
tsort: elpa-ivy
tsort: emacsen-common
Install elpa-ivy for emacs
install/ivy-0.12.0: Handling install of emacsen flavor emacs
install/ivy-0.12.0: byte-compiling for emacs
>>Error occurred processing *.el: File is missing (("Opening input file" "No such file or directory" "/usr/share/emacs/site-lisp/elpa/ivy-0.12.0/*.el"))
ERROR: install script from elpa-ivy 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
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have been running this errand for almost a full day and have tried lots of other things (apt-get updates, purge vs remove, etc.) trying to solve the missing ivy .el files and dependencies but without any luck. Thank you in advance for any help.

  • This question should better be asked on a Linux Mint forum: it seems to be a packaging issue specific to Mint. It is almost certainly not an Emacs problem. I realize that you "solved" it, but you are likely to get more and better help on an Ubuntu forum (as you eventually found out) or on the Unix and Linux SE site or perhaps on the Superuser SE site. Choosing a good place to ask a question is almost as important as asking a good question.
    – NickD
    Apr 12, 2022 at 14:40
  • 2
    I’m voting to close this question because this seems to be a packaging problem with Mint. AskUbuntu or the Ubuntu forums are better candidates for getting a solution. Unix and Linux SE might be a fallback.
    – NickD
    Apr 12, 2022 at 14:42
  • Fair enough. I can vote to close it as well but under what option? I've tried "duplicate" using the Ubuntu forum and have been notified that is not a stack exchange forum so I am open to suggestions :-)
    – Ajned
    Apr 12, 2022 at 14:46
  • This is more guidance for the future - do not worry too much about it.
    – NickD
    Apr 12, 2022 at 15:08

1 Answer 1


I was able to solve it by following the guidance here

Specifically, I had to keep creating trash.el files in each and every of the directories with missing files. For example

sudo touch /usr/share/emacs/site-lisp/elpa/ivy-0.12.0/trash.el

After creating 6-7 files in different directories it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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