22

I have been using vim for years, and I don't really like it.

I'd like to try emacs for a while, but it's not installed on any of the linux servers I use regularly. I don't have root so apt-get install isn't an option (nor can I ask the sysadmin for permission, he would definitely say no).

Is there a binary version of emacs I can install in my home directory? Most of the servers are running CentOS.

  • Do you have compilation tools? Can't be too hard to compile it with the right flags see this question for pointers and run it directly off your home folder. – Journeyman Geek Aug 29 '13 at 0:53
  • @JourneymanGeek yes, gcc appears to be available to my user on at least some of the servers. I've never tested it. I'm a bit nervous about running make install incase it does something the sysadmin would get pissed off about... I work with production servers every day, and I'm not the one who has to wake up at 2am if something goes wrong. – Abhi Beckert Aug 29 '13 at 1:04
  • Upvoted purely for being concerned that your sysadmin gets a good night's sleep; having spent several years in that role among others, I could wish more of my users had entertained the same concern. – Aaron Miller Aug 30 '13 at 0:44
  • Related, see Minimal emacs24 installation on ubuntu. It shows you how to configure and build emacs from sources for a small footprint. Its usually produces a smaller footprint than provided with packages like emacs-nox or emacs24-nox. – jww Feb 3 '16 at 22:35
30

If you can compile code, then just download a source distribution of emacs.

Instead of starting with ./configure, use the configure options to tell the build system where you want the files to end up. For example:

./configure --prefix=/home/abhi/emacs --bindir=/home/abhi/bin

will install all of emacs' support files under /home/abhi/emacs, and the emacs executables in /home/abhi/bin. If the latter is in your $PATH, which it usually is, then things should Just Work(sm).

After that you can

make && make install

without worrying about the installation putting files other than in your home directory.

(This is all based on your home directory being /home/abhi, of course. Edit as necessary.)

  • 5
    Just to toss in my two bits here: I don't have root on my desktop machine at work, and this is exactly how I built and installed Emacs, with the slight difference that my configure command was ./configure --prefix=~/installs and my $PATH includes ~/installs/bin -- Emacs isn't the only thing I've built and installed for myself, and I find it preferable to keep everything under a single directory so's not to clutter up $HOME too much, but I suppose that's more a matter of taste than anything. – Aaron Miller Aug 30 '13 at 0:43
  • 2
    FWIW, for emacs 24.3: $ ./configure --prefix=~/software --bindir=~/bin yields configure: error: expected an absolute directory name for --prefix: ~/software. So maybe use $HOME instead. – user100464 Mar 28 '14 at 15:24
  • 2
    This mostly worked for me. On the server I was compiling on, the /libgif/libungif libraries were not found so I had to add --with-gif=no to the ./configure command. – Steven C. Howell Jun 11 '15 at 16:31
  • @StevenC.Howell what do those flags do? – Michael Mar 6 '18 at 13:40
  • 2
    @michael: --with-gif=no suppresses building support for GIF image files into emacs. (Yes, emacs can display image files. See gnu.org/software/emacs/manual/html_node/emacs/…). There are a number of other such flags; execute ./configure --help for a list. – rici Mar 6 '18 at 14:10
5

Installing from source, or manually downloading .rpms and extracting them are possible but hard because they all depend on other libs.

Here is a simple way using conda

conda install -c conda-forge emacs

If you dont have conda and like to install it, see [1]

emacs has been pre built for OS X and linux_64 platforms, see [2] for versions.

[1] https://conda.io/miniconda.html
[2] https://anaconda.org/conda-forge/emacs

  • 2
    I cannot believe that I can install emacs using conda. Thanks! – CodyChan Jul 27 '18 at 10:47
  • 1
    :-D. I had spent an hour trying to build emacs from scratch (because I didn't have root privileges on a server, and admins didn't help me), and I felt 'there must be a simpler way'. Surely, there was a simpler way with conda – Thamme Gowda Jul 27 '18 at 20:27
  • 1
    I don't have root privileges on a server either, but I used to compile emacs from scratch multiple times (may have to fix some missed libs), the key point now is I failed to compile emacs from scratch because of some errors when compiling. Anyway, I managed to install the latest version of emacs using conda, this is a new and clean way I learned from you. thanks. – CodyChan Jul 30 '18 at 3:43
  • 1
    incredible, this is the best answer – Prasad Chalasani Sep 6 '18 at 15:46
1

Don't install emacs onto the servers - there is no reason to force yourself to use the interface through network latency. Instead, install emacs onto your workstation, and let it fetch the files from the servers using its TRAMP mode. Alternatively, you can use Filezilla, it will download the file for you and automatically upload them after you save.

  • 1
    I have less than 1ms of latency to some of the servers, and very good latency to the others. We use a nearby data centre. Latency is not an issue for any other editor and I want to use it as my $EDITOR for things like typing in commit messages for version control. I'm never doing serious programming on a remote server, I use my local workstation which already has emacs installed. – Abhi Beckert Aug 29 '13 at 2:07
  • 1
    @AbhiBeckert Well, in that case maybe you do want to go through the pain of trying to install it. I wouldn't be afraid of doing a make install, as long as you aren't root it can't do anything outside your home directory. Also, you might want to see if nano is installed, if you prefer modeless editing. – wingedsubmariner Aug 29 '13 at 2:47

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.