How to install emacs using YUM without X11 libraries?
Solution 1
No. There is emacs-nox
on CentOS and Fedora.
$ sudo yum -y install emacs-nox
Solution 2
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
Solution 3
I follow these steps to install Emacs on my cloud Ubuntu server without X support:
sudo apt-get install autoconf automake texinfo libncurses5-dev
./autogen.sh
./configure --with-x=no
make
sudo make install
And now you can use Emacs in the terminal.
autoconf
and automake
are the required system tools.
If you miss texinfo
, you'll get:
configure: error: You do not seem to have makeinfo >= 4.7, and your source tree does not seem to have pre-built manuals in the 'info' directory. Either install a suitable version of makeinfo, or re-run configure with the '--without-makeinfo' option to build without the manuals.
If you miss libncurses5-dev
, you'll get:
configure: error: The required function 'tputs' was not found in any library. The following libraries were tried (in order): libtinfo, libncurses, libterminfo, libtermcap, libcurses Please try installing whichever of these libraries is most appropriate for your system, together with its header files. For example, a libncurses-dev(el) or similar package.
Related videos on Youtube
![crownedjitter](https://i.stack.imgur.com/QmwYF.jpg?s=256&g=1)
crownedjitter
A Java Developer who has worked at places ranging from a Fortune 100 company to a small start-up. Using Java for over 20 years.
Updated on September 18, 2022Comments
-
crownedjitter almost 2 years
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 runyum install emacs
and it shows me the list of dependencies it wants to download.These dependencies
libcairo
,libasound
, and a ton oflibX*
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?
-
Steven C. Howell about 9 yearsWhy 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 gettingemacs: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory
. I knew I did not needgtk-3
for a headless installation and after using this, it ran without any problems. When I usedsudo yum -y install emacs-nox
I gotNo package emacs-nox available Error: Nothing to do
. -
chriskelly over 8 yearsProbably downvoted because apt-get is not yum. The answer is otherwise ok.
-
rvalue about 8 years@stvn66 Because it ignores the stated OS (CentOS 6.3) and the stated package manager (yum). Providing from-source build instructions for a different OS with dependencies from a different package manager is objectively the wrong answer.
-
David C. over 6 yearsAbsolutely correct if you want to avoid pulling in all the GUI dependencies. But it is worth noting that even if the system will not be running a GUI console, if you have users that log in remotely from computers running an X server, they may want to run the GUI version of emacs, which will need these packages.
-
crownedjitter almost 4 yearsPresumably you downloaded the Emacs source tarball at some point?
-
Peter Mortensen over 3 yearsBut doesn't it still require a lot of packages to be installed first (development versions)? Like
libgtk-3-dev libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev libncurses-dev
? -
Peter Mortensen over 3 yearsWhat system (incl. version) did you try this on?