Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have installed a minimal installation of CentOS 6.3 inside a VirtualBox VM. Now, I would like to install Emacs for use from the command line only.

When I do a search for emacs using yum search emacs the only application level package seems to be "emacs" so I run yum install emacs and it shows me the list of dependencies it wants to download.

These dependencies libcairo, libasound, and a ton of libX* packages that have no business being downloaded and installed for a copy of Emacs that will be used from the command line only (I am trying to keep this minimal since this will be cloned 10 times per developer machine for network simulation but a text editor really is necessary).

So, are there some flags to set to prevent all the graphical related packages from installing? I remember Gentoo's emerge had paremeters like that, or am I just installing the wrong package?

share|improve this question

3 Answers 3

up vote -1 down vote accepted

This original answer was incorrect. See the answer from xning.

share|improve this answer
at what time do you specify the --without-x ? automake? make? environment variable? –  ArtB Dec 28 '12 at 18:21
@ArtB answer updated. –  jordanm Dec 28 '12 at 19:20
see @xning's answer below –  Brian Leathem Mar 20 at 18:31
@BrianLeathem yep, the answer is wrong but I can't delete it because it was accepted.... –  jordanm Mar 20 at 21:46
@jordanm maybe edit your answer referencing xning's answer? –  Brian Leathem Mar 20 at 23:01

I loath the GUI. Try this:

Download the latest tar: http://mirror.sdunix.com/gnu/emacs/

## extract it *24.5 is the current.    
$ tar -xvf emacs-24.5.tar.xz

## get emacs dep libs.
$ sudo apt-get build-dep emacs24

## mv to extracted dir.     
$ ./configure --with-x=no

## build.
$ make

## mv binaries system wide.    
$ make install
share|improve this answer
Why did this get downvoted with no comments? Is there something wrong with this? This was exactly what I needed for installing to a headless CentOS server. Before using ./configure --with-x=no I kept getting emacs: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory. I knew I did not need gtk-3 for a headless installation and after using this, it ran without any problems. When I used sudo yum -y install emacs-nox I got No package emacs-nox available Error: Nothing to do. –  stvn66 Jun 26 at 23:32

No. There is emacs-nox on CentOS and Fedora.

$ sudo yum -y install emacs-nox
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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