I'm working for the first time on an Ubuntu 16.04 LTS machine, and honestly I'm not sure if this is an emacs build/debian package question or if it's an Ubuntu 16.04 question. Please nudge me in the right direction.

When I got this new machine I installed emacs from the up-to-date apt repository and got emacs 24.5.1.

I wanted to get the latest/greatest, and so I used the information found at ubuntuhandbook.org/index.php/2016/09/install-gnu-emacs-25-1-in-ubuntu-16-04/ to get and build the source to a .deb file, and then install it using dpkg. That all seemed to work fine without error.

Having done that, I had /usr/bin/emacs pointing to 24.5.1 and /usr/local/bin/emacs pointing to 25.2-1. Both seem to execute fine.

When I look at the package information using "apt-cache show emacs" I see both:

Package: emacs
Version: 46.1
Section: editors
Depends: emacs24 | emacs24-lucid | emacs24-nox

Package: emacs
Version: 25.2-1
Section: checkinstalled
<no Depends>

When I installed the newly built 25.2-1 version, dpkg announced:

dpkg: warning: downgrading emacs from 46.1 to 25.2-1

Finally, when I got on the machine a day later, I found that my new emacs 25.2-1 was gone. This morning I learned about the unattended-upgrades package which is installed and has enabled auto upgrades of available packages. So, I think what is going on is that on a daily basis an upgrade is performed which "fixes" the "downgrade" that I manually performed.

Does anybody know how to resolve this? Can both coexist? Are there known issues with the instructions I used for building 25.2 for Ubuntu? Do I need to build emacs 25.2 differently so the package version is 46.2 (seems like a hack)? Is there something about my built package being in Section "checkinstalled" that impacts this? I'm not sure where to go.

What I'd like not to do is disable unattended upgrades if that can be avoided.

Thanks for your time.

  • It might be easier to remove the Ubuntu emacs packages entirely and install Emacs by compiling from source. Otherwise, configuring your apt repositories is off topic here - you should raise it on the Ubuntu forum.
    – Tyler
    Sep 1 '17 at 17:20
  • 1
    46 must be a version of the package, not of Emacs. Maybe, if you really want to compile a package, just change the version in the package description to something greater. But, really, I see little merit in trying to install programs through apt, if you build them yourself, unless you have your own repository, build on a regular basis and so on (a programming company might want that, but this would be an overkill for personal use).
    – wvxvw
    Sep 1 '17 at 17:32
  • This seems more like an ubuntu question than an emacs question.
    – Dan
    Sep 3 '17 at 11:45

In order to avoid conficts with the standard package you should give a custom name to the one you build, for example adding the suffix "local-build".

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