Emacs 24.3出来好久了,但是在Debian 7里还是Emacs 23的版本.
以下是安装步骤(9步):
sudo aptitude install git-core libxaw7-dev libxpm-dev libpng12-dev libtiff5-dev libgif-dev libjpeg8-dev libgtk2.0-dev libncurses5-dev autoconf automake texinfosudo apt-get build-dep emacsgit clone git://git.savannah.gnu.org/emacs.git cd emacs/git checkout emacs-24.3git checkout -b custom_branch./autogen.sh./configure --prefix=/opt/emacs24make --jobs=2sudo make install
按这个顺序安装就好了,大概半个小时到一个小时的样子。
安装好后把emacs添加到PATH里,打开~/.bashrc 文件,在最后添加:
export PATH=$PATH:/opt/emacs24/bin
保存后:
source .bashrc
这样在终端里就可以直接输入 emacs 就可以启动了。
经常按alt+F2 打开应用程序窗口,但是这里面输入emacs却不行,办法是把emacs软链接到 /usr/bin 目录里:
cd /usr/binln -s /opt/emacs24/bin/emacs emacs
打完收工!
2010.10.03 更新:
以上通过git的方式今天用起来好慢!只好换一种方式。
一、安装编译所需包 2014.10.03 10:43~10:45
sudo apt-get install libxaw7-dev libxpm-dev libpng12-dev libtiff5-dev libgif-dev libjpeg8-dev libgtk2.0-dev libncurses5-dev autoconf automake texinfo
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成 将会安装下列额外的软件包: autopoint autotools-dev debhelper gettext html2text intltool-debian libatk1.0-dev libcairo-script-interpreter2 libcairo2-dev libelf1 libexpat1-dev libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libgettextpo0 libglib2.0-bin libglib2.0-dev libice-dev libjbig-dev liblzma-dev libmail-sendmail-perl libpango1.0-dev libpcre3-dev libpcrecpp0 libpixman-1-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev libsys-hostname-long-perl libtiff5 libtiffxx5 libtinfo-dev libx11-dev libx11-doc libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-utils libxmu-dev libxmu-headers libxrandr-dev libxrender-dev libxt-dev m4 pkg-config po-debconf x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev建议安装的软件包: autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool dh-make gettext-doc libcairo2-doc libglib2.0-doc libgtk2.0-doc libice-doc liblzma-doc ncurses-doc libpango1.0-doc imagemagick libsm-doc libxaw-doc libxcb-doc libxext-doc libxt-doc libmail-box-perl texlive-base texlive-latex-base texlive-generic-recommended texinfo-doc-nonfree下列【新】软件包将被安装: autoconf automake autopoint autotools-dev debhelper gettext html2text intltool-debian libatk1.0-dev libcairo-script-interpreter2 libcairo2-dev libelf1 libexpat1-dev libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libgettextpo0 libgif-dev libglib2.0-bin libglib2.0-dev libgtk2.0-dev libice-dev libjbig-dev libjpeg8-dev liblzma-dev libmail-sendmail-perl libncurses5-dev libpango1.0-dev libpcre3-dev libpcrecpp0 libpixman-1-dev libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev libsys-hostname-long-perl libtiff5 libtiff5-dev libtiffxx5 libtinfo-dev libx11-dev libx11-doc libxau-dev libxaw7-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-utils libxmu-dev libxmu-headers libxpm-dev libxrandr-dev libxrender-dev libxt-dev m4 pkg-config po-debconf texinfo x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev升级了 0 个软件包,新安装了 80 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。需要下载 28.1 MB 的软件包。解压缩后会消耗掉 91.4 MB 的额外空间。您希望继续执行吗?[Y/n]
Yes后开始下载安装这些包,结束时有此提示:
在处理时有错误发生: /var/cache/apt/archives/libfontconfig1-dev_2.9.0-7.1_amd64.debE: Sub-process /usr/bin/dpkg returned an error code (1)
google了下,好像是下载文件不完整造成的,删除该包,重新下载安装:
sudo rm /var/cache/apt/archives/libfontconfig1-dev_2.9.0-7.1_amd64.debsudo apt-get install libfontconfig1-dev
二、下载emacs压缩包
从这里下载:http://mirror.bjtu.edu.cn/gnu/emacs/ 文件叫 emacs-24.3.tar.gz 有50M,下载在Download目录里。
$ cd ~/Download$ tar zxvf emacs-24.3.tar.gz # 解压后有170M。
三、编译前配置 11:13~11:14
在Download目录里新建一个目录放置编译时生成的文件,以免所有的文件都在解压后的 emacs-24.3 目录里。
$ mkdir compileemacs # 放置编译后生成的文件$ cd compileemacs$ ../emacs-24.3/configure --prefix=/opt/emacs
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... nochecking for mawk... mawkchecking whether make sets $(MAKE)... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking for style of include used by make... GNUchecking dependency style of gcc... gcc3checking whether gcc and cc understand -c and -o together... yeschecking how to run the C preprocessor... gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for Minix Amsterdam compiler... nochecking for ar... archecking for ranlib... ranlibchecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking minix/config.h usability... nochecking minix/config.h presence... nochecking for minix/config.h... nochecking whether it is safe to define __EXTENSIONS__... yeschecking for special C compiler options needed for large files... nochecking for _FILE_OFFSET_BITS value needed for large files... nochecking for gcc option to accept ISO C99... -std=gnu99checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99checking whether gcc -std=gnu99 accepts -g3 -O2... yeschecking whether ln -s works... yeschecking for install-info... /usr/bin/install-infochecking for gzip... /bin/gzipchecking for paxctl... nochecking for makeinfo... /usr/bin/makeinfochecking for -znocombreloc... yeschecking for pkg-config... /usr/bin/pkg-configchecking machine/soundcard.h usability... nochecking machine/soundcard.h presence... nochecking for machine/soundcard.h... nochecking sys/soundcard.h usability... yeschecking sys/soundcard.h presence... yeschecking for sys/soundcard.h... yeschecking soundcard.h usability... nochecking soundcard.h presence... nochecking for soundcard.h... nochecking for _oss_ioctl in -lossaudio... nochecking for alsa >= 1.0.0... nochecking for linux/version.h... yeschecking for sys/systeminfo.h... nochecking for stdio_ext.h... yeschecking for fcntl.h... yeschecking for coff.h... nochecking for pty.h... yeschecking for sys/vlimit.h... yeschecking for sys/resource.h... yeschecking for sys/utsname.h... yeschecking for pwd.h... yeschecking for utmp.h... yeschecking for dirent.h... yeschecking for util.h... nochecking for sys/socket.h... yeschecking for stdlib.h... (cached) yeschecking for unistd.h... (cached) yeschecking for sys/param.h... yeschecking for pthread.h... yeschecking for malloc/malloc.h... nochecking for maillock.h... nochecking for sys/un.h... yeschecking for execinfo.h... yeschecking for getopt.h... yeschecking for sys/time.h... yeschecking for wchar.h... yeschecking for stdint.h... (cached) yeschecking for inttypes.h... (cached) yeschecking for sys/select.h... yeschecking for sys/stat.h... (cached) yeschecking for utime.h... yeschecking if personality LINUX32 can be set... yeschecking for term.h... yeschecking whether time.h and sys/time.h may both be included... yeschecking whether sys_siglist is declared... yeschecking for sys/wait.h that is POSIX.1 compatible... yeschecking for speed_t... yeschecking for net/if.h... yeschecking for ifaddrs.h... yeschecking for net/if_dl.h... nochecking for struct ifreq.ifr_flags... yeschecking for struct ifreq.ifr_hwaddr... yeschecking for struct ifreq.ifr_netmask... yeschecking for struct ifreq.ifr_broadaddr... yeschecking for struct ifreq.ifr_addr... yeschecking for struct ifreq.ifr_addr.sa_len... nochecking whether we are using GNU Make... yeschecking whether gcc understands -MMD -MF... yeschecking for long file names... yeschecking for X... libraries , headerschecking whether malloc is Doug Lea style... yeschecking for getpagesize... yeschecking for working mmap... yeschecking for dnet_ntoa in -ldnet... nochecking for main in -lXbsd... nochecking for pthread_self in -lpthread... yeschecking for cma_open in -lpthreads... nochecking whether X on GNU/Linux needs -b to link... nochecking for Xkb... yeschecking for XrmSetDatabase... yeschecking for XScreenResourceString... yeschecking for XScreenNumberOfScreen... yeschecking X11 version 6... 6 or newerchecking for librsvg-2.0 >= 2.11.0... nochecking for Wand >= 6.2.8... nochecking for gtk+-3.0 >= 3.0 glib-2.0 >= 2.28... nochecking for gtk+-2.0 >= 2.10 glib-2.0 >= 2.10... yes CFLAGS='-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 ' LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 'checking for gtk_main... yeschecking whether GTK_TYPE_FILE_SELECTION is declared... yeschecking for gtk_file_selection_new... yeschecking for gtk_widget_get_window... yeschecking for gtk_widget_set_has_window... yeschecking for gtk_dialog_get_action_area... yeschecking for gtk_widget_get_sensitive... yeschecking for gtk_widget_get_mapped... yeschecking for gtk_adjustment_get_page_size... yeschecking for gtk_orientable_set_orientation... yeschecking for gtk_window_set_has_resize_grip... nochecking for dbus-1 >= 1.0... nochecking for gio-2.0 >= 2.26... yes CFLAGS='-pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include ' LIBS='-lgio-2.0 -lgobject-2.0 -lglib-2.0 'checking for gconf-2.0 >= 2.13... nochecking for gobject-2.0 >= 2.0... yes CFLAGS='-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include ' LIBS='-lgobject-2.0 -lglib-2.0 'checking for g_type_init... yeschecking for lgetfilecon in -lselinux... nochecking for gnutls >= 2.6.6... nochecking for gnutls_certificate_set_verify_function... nochecking for fontconfig >= 2.2.0... yes CFLAGS=' ' LIBS='-lfontconfig 'checking for xft >= 0.13.0... yes CFLAGS='-I/usr/include/freetype2 ' LIBS='-lXft 'checking for XRenderQueryExtension in -lXrender... yeschecking X11/Xft/Xft.h usability... yeschecking X11/Xft/Xft.h presence... yeschecking for X11/Xft/Xft.h... yeschecking for XftFontOpen in -lXft... yeschecking for freetype2... yes CFLAGS='-I/usr/include/freetype2 ' LIBS='-lfreetype 'checking for libotf... nochecking X11/xpm.h usability... yeschecking X11/xpm.h presence... yeschecking for X11/xpm.h... yeschecking for XpmReadFileToPixmap in -lXpm... yeschecking for XpmReturnAllocPixels preprocessor define... yeschecking jerror.h usability... yeschecking jerror.h presence... yeschecking for jerror.h... yeschecking for jpeg_destroy_compress in -ljpeg... yeschecking png.h usability... yeschecking png.h presence... yeschecking for png.h... yeschecking for png_get_channels in -lpng... yeschecking whether png_longjmp is declared... nochecking tiffio.h usability... yeschecking tiffio.h presence... yeschecking for tiffio.h... yeschecking for TIFFGetVersion in -ltiff... yeschecking gif_lib.h usability... yeschecking gif_lib.h presence... yeschecking for gif_lib.h... yeschecking for EGifPutExtensionLast in -lgif... yeschecking gpm.h usability... nochecking gpm.h presence... nochecking for gpm.h... nochecking X11/SM/SMlib.h usability... yeschecking X11/SM/SMlib.h presence... yeschecking for X11/SM/SMlib.h... yeschecking for SmcOpenConnection in -lSM... yeschecking for libxml-2.0 > 2.6.17... nochecking whether netdb declares h_errno... yeschecking for sqrt in -lm... yeschecking for maillock in -lmail... nochecking for maillock in -llockfile... nochecking for liblockfile.so... nochecking for gethostname... yeschecking for closedir... yeschecking for getrusage... yeschecking for get_current_dir_name... yeschecking for lrand48... yeschecking for setsid... yeschecking for fpathconf... yeschecking for select... yeschecking for euidaccess... yeschecking for getpagesize... (cached) yeschecking for setlocale... yeschecking for utimes... yeschecking for getrlimit... yeschecking for setrlimit... yeschecking for setpgid... yeschecking for getcwd... yeschecking for shutdown... yeschecking for getaddrinfo... yeschecking for __fpending... yeschecking for strsignal... yeschecking for setitimer... yeschecking for sendto... yeschecking for recvfrom... yeschecking for getsockname... yeschecking for getpeername... yeschecking for getifaddrs... yeschecking for freeifaddrs... yeschecking for gai_strerror... yeschecking for mkstemp... yeschecking for getline... yeschecking for getdelim... yeschecking for fsync... yeschecking for sync... yeschecking for difftime... yeschecking for posix_memalign... yeschecking for getpwent... yeschecking for endpwent... yeschecking for getgrent... yeschecking for endgrent... yeschecking for touchlock... nochecking for cfmakeraw... yeschecking for cfsetspeed... yeschecking for copysign... yeschecking for __executable_start... yeschecking for getwd... yeschecking for random... yeschecking for rint... yeschecking for __builtin_unwind_init... yeschecking for _LARGEFILE_SOURCE value needed for large files... nochecking whether getpgrp requires zero arguments... yeschecking for grantpt... yeschecking for getpt... yeschecking for posix_openpt... yeschecking for library containing tputs... -ltinfochecking for tzset... yeschecking for readlinkat... yeschecking for gettimeofday... yeschecking for nanotime... nochecking for lstat... yeschecking for alarm... yeschecking for pselect... yeschecking for pthread_sigmask... yeschecking for readlink... yeschecking for strtoimax... yeschecking for strtoumax... yeschecking for symlink... yeschecking for localtime_r... yeschecking for futimes... yeschecking for futimesat... yeschecking for futimens... yeschecking for utimensat... yeschecking for lutimes... yeschecking whether localtime caches TZ... nochecking for socket... yeschecking netinet/in.h usability... yeschecking netinet/in.h presence... yeschecking for netinet/in.h... yeschecking arpa/inet.h usability... yeschecking arpa/inet.h presence... yeschecking for arpa/inet.h... yeschecking whether system supports dynamic ptys... yeschecking for pid_t... yeschecking vfork.h usability... nochecking vfork.h presence... nochecking for vfork.h... nochecking for fork... yeschecking for vfork... yeschecking for working fork... yeschecking for working vfork... (cached) yeschecking for snprintf... yeschecking for nl_langinfo and CODESET... yeschecking for mbstate_t... yeschecking for C restricted array declarations... yeschecking for signals via characters... yeschecking whether we are using the GNU C library... yeschecking for style of pending output formalism... newchecking for _setjmp... yeschecking for usable FIONREAD... yeschecking for usable SIGIO... yeschecking for working alloca.h... yeschecking for alloca... yeschecking whether byte ordering is bigendian... nochecking for inline... inlinechecking whether strtold conforms to C99... yeschecking if environ is properly declared... yeschecking for st_dm_mode in struct stat... nochecking whether strmode is declared... nochecking whether the preprocessor supports include_next... yeschecking whether system header files limit the line length... nochecking for getopt.h... (cached) yeschecking for getopt_long_only... yeschecking whether getopt is POSIX compatible... yeschecking for working GNU getopt function... nochecking whether getenv is declared... yeschecking for C/C++ restrict keyword... __restrictchecking for struct timeval... yeschecking for wide-enough struct timeval.tv_sec member... yeschecking for unsigned long long int... yeschecking for long long int... yeschecking whether stdint.h conforms to C99... yeschecking whether lstat correctly handles trailing slash... yeschecking whetheris self-contained... yeschecking for sigset_t... yeschecking for stdbool.h that conforms to C99... yeschecking for _Bool... yeschecking for wchar_t... yeschecking whether struct tm is in sys/time.h or time.h... time.hchecking for struct tm.tm_zone... yeschecking for struct tm.tm_gmtoff... yeschecking whether strtoimax is declared... yeschecking whether strtoumax is declared... yeschecking whether stat file-mode macros are broken... nochecking for mode_t... yeschecking for struct timespec in ... yeschecking whether the utimes function works... yeschecking for struct utimbuf... yeschecking for alloca as a compiler built-in... yeschecking for library containing clock_gettime... -lrtchecking for clock_gettime... yeschecking for clock_settime... yeschecking whether dup2 works... yeschecking for library containing backtrace_symbols_fd... none requiredchecking for getloadavg... yeschecking sys/loadavg.h usability... nochecking sys/loadavg.h presence... nochecking for sys/loadavg.h... nochecking whether getloadavg is declared... yeschecking whether gettimeofday clobbers localtime buffer... nochecking for gettimeofday with POSIX signature... almostchecking for working mktime... yeschecking whether signature of pselect conforms to POSIX... yeschecking whether pselect detects invalid fds... yeschecking whether pthread_sigmask works without -lpthread... yeschecking whether pthread_sigmask returns error numbers... yeschecking whether pthread_sigmask unblocks signals correctly... guessing yeschecking whether readlink signature is correct... yeschecking whether readlink handles trailing slash correctly... yeschecking for volatile sig_atomic_t... yeschecking for sighandler_t... yeschecking for socklen_t... yeschecking for ssize_t... yeschecking for struct stat.st_atim.tv_nsec... yeschecking whether struct stat.st_atim is of type struct timespec... yeschecking for struct stat.st_birthtimespec.tv_nsec... nochecking for struct stat.st_birthtimensec... nochecking for struct stat.st_birthtim.tv_nsec... nochecking for working stdalign.h... nochecking for va_copy... yeschecking whether NULL can be used in arbitrary expressions... yeschecking whether strtoimax works... yeschecking whether symlink handles trailing slash correctly... yeschecking whether is self-contained... (cached) yeschecking for nlink_t... yeschecking whether localtime_r is declared... yeschecking whether localtime_r is compatible with its POSIX signature... yeschecking for library containing timer_settime... -lrtchecking for timer_settime... yesConfigured for `x86_64-unknown-linux-gnu'. Where should the build process find the source code? /home/z/Download/emacs-24.3 What compiler should emacs be built with? gcc -std=gnu99 -g3 -O2 Should Emacs use the GNU version of malloc? yes (Using Doug Lea's new malloc from the GNU C Library.) Should Emacs use a relocating allocator for buffers? no Should Emacs use mmap(2) for buffer allocation? no What window system should Emacs use? x11 What toolkit should Emacs use? GTK2 Where do we find X Windows header files? Standard dirs Where do we find X Windows libraries? Standard dirs Does Emacs use -lXaw3d? no Does Emacs use -lXpm? yes Does Emacs use -ljpeg? yes Does Emacs use -ltiff? yes Does Emacs use a gif library? yes -lgif Does Emacs use -lpng? yes Does Emacs use -lrsvg-2? no Does Emacs use imagemagick? no Does Emacs use -lgpm? no Does Emacs use -ldbus? no Does Emacs use -lgconf? no Does Emacs use GSettings? yes Does Emacs use -lselinux? no Does Emacs use -lgnutls? no Does Emacs use -lxml2? no Does Emacs use -lfreetype? yes Does Emacs use -lm17n-flt? no Does Emacs use -lotf? no Does Emacs use -lxft? yes Does Emacs use toolkit scroll bars? yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating lib/Makefileconfig.status: creating lib-src/Makefileconfig.status: creating oldXMenu/Makefileconfig.status: creating doc/emacs/Makefileconfig.status: creating doc/misc/Makefileconfig.status: creating doc/lispintro/Makefileconfig.status: creating doc/lispref/Makefileconfig.status: creating src/Makefileconfig.status: creating lwlib/Makefileconfig.status: creating lisp/Makefileconfig.status: creating leim/Makefileconfig.status: creating nextstep/Makefileconfig.status: creating admin/unidata/Makefileconfig.status: creating src/config.hconfig.status: executing depfiles commandsconfig.status: executing mkdirs commandsconfig.status: executing epaths commandscreating src/epaths.hconfig.status: executing gdbinit commandscreating src/.gdbinit
四、编译 11:21~11:29
$ make
五、安装 11:47~11:48
sudo make install
安装成功后添加到环境变量中:
export PATH=$PATH:/opt/emacs24/bin
软链接到 /usr/bin 目录里:
cd /usr/binln -s /opt/emacs24/bin/emacs emacsls -l emacs lrwxrwxrwx 1 root root 22 10月 3 11:54 emacs -> /opt/emacs24/bin/emacs
--End--