3

When installing emacs 24.5 by compiling its source, I run ./config --prefix=/usr and then make and then sudo checkinstall which creates a deb package and installs the binary files to /usr.

Now I would like to change installation directory to be /usr/local. I wonder if I must do the steps all over again, including compiling? Or do you recommend me to do so?

Is the deb package bound to /usr? No way to change it to bind to /usr/local?

Tim
  • 98,580
  • 191
  • 570
  • 977

1 Answers1

2

Short answer: you should recompile

Long answer:

You don't have to recompile after changing the prefix from /usr to /usr/local with ./configure, but since emacs uses the prefix in pathnames embedded within the executable (such as /usr/lib/emacs/24.5/i686-pc-linux-gnu and /usr/share/emacs/24.5/etc; see src/epaths.h), some files that emacs reads at runtime will not be found, unless either

  • you recompile emacs (recommended)
  • before running emacs, you set and export environment variables such as EMACSDATA, EMACSDOC, and EMACSPATH to override the incorrect builtin pathnames.
  • you make symlinks in various places in /usr to point to various places in /usr/local so that the incorrect builtin pathnames resolve to the new locations.

Running checkinstall to monitor the make install procedure and generate a .deb package comprised of all the installed files won't mitigate any of this; the emacs binary will still contain incorrect pathnames.

Mark Plotnick
  • 24,913
  • 2
  • 59
  • 81