0

I am trying to install Emacs25 package on Ubuntu 16.04 alongside Emacs 24 and Emacs-snapshot (currently Emacs 27.0.50).

I ran the following commands

sudo add-apt-repository ppa:kelleyk/emacs 
sudo apt-get update 

After that I ran

sudo apt install emacs25

during which I get this

user@user-desktop:$ sudo apt install emacs25
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  emacs25-common
The following NEW packages will be installed:
  emacs25 emacs25-common
0 upgraded, 2 newly installed, 0 to remove and 132 not upgraded.
Need to get 0 B/21.0 MB of archives.
After this operation, 90.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 298195 files and directories currently installed.)
Preparing to unpack .../emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb ...
Unpacking emacs25-common (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb (--unpack):
 trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs-snapshot-common 20190326:96618-9a6cba2~ubuntu16.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package emacs25.
Preparing to unpack .../emacs25_92792-c3ff671-emacs-25.2~ubuntu16.04.1_amd64.deb ...
Unpacking emacs25 (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

How I could troubleshoot this?

1

You can troubleshoot this using the following error message in the output you’ve quoted:

Unpacking emacs25-common (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb (--unpack):
 trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs-snapshot-common 20190326:96618-9a6cba2~ubuntu16.04.1

The installation failed because both emacs-snapshot-common and emacs25-common contain /usr/share/emacs/site-lisp/subdirs.el.

There are a number of ways to get past this, but it’s worth considering that the Emacs packages, in spite of the fact that they include a version number in their name, are not designed to be co-installable. (In fact, starting with Debian 10 and Ubuntu 18.10, the packages no longer include the version number in their name.)

The cleanest way to fix this it to divert one of the package’s copy of the file; for example, to keep emacs25’s copy:

sudo dpkg-divert --package emacs25 --divert /usr/share/emacs/site-lisp/subdirs.el.moved --rename /usr/share/emacs/site-lisp/subdirs.el

(the syntax is rather counter-intuitive; see the dpkg-divert manpage for details). This will rename any version of subdirs.el provided by another package than emacs25 to subdirs.el.moved.

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.