ubuntu下面无网络的情况下安装 emacs

因为有朋友问我这个问题,所以我就实践一下,写了下来. 

1, 在其它能上网的电脑上面下载 emacs :
http://www.gnu.org/software/emacs/emacs.html

 

  1. wget -c http://ftp.gnu.org/pub/gnu/emacs/emacs-23.2.tar.gz  
  2. 82% [===============================>       ] 38,794,237   438K/s  ETA 23s       

2, 解压
tar -xf emacs-23.2.tar.gz
cd emacs-23.2


3,看 README , 再看 INSTALL


INSTALL 里面写着:


  1. 1. Make sure your system has at least 120 MB of free disk space.    
  2. 2a. `cd' to the directory where you unpacked Emacs and invoke the    
  3. `configure' script:    
  4. ./configure    
  5. 2b. Alternatively, create a separate directory, outside the source    
  6. directory, where you want to build Emacs, and invoke `configure'    
  7. from there:    
  8. SOURCE-DIR/configure    
  9. where SOURCE-DIR is the top-level Emacs source directory.  This    
  10. may not work unless you use GNU make.    
  11. 3. When `configure' finishes, it prints several lines of details    
  12. about the system configuration.  Read those details carefully    
  13. looking for anything suspicious, such as wrong CPU and operating    
  14. system names, wrong places for headers or libraries, missing    
  15. libraries that you know are installed on your system, etc.    
  16. If you find anything wrong, you will have to pass to `configure'    
  17. explicit machine configuration name, and one or more options    
  18. which tell it where to find various headers and libraries; refer    
  19. to DETAILED BUILDING AND INSTALLATION section below.    
  20. If `configure' didn't find some image support libraries, such as    
  21. Xpm, jpeg, etc., and you want to use them refer to the subsection    
  22. "Image support libraries", below.    
  23. If the details printed by `configure' don't make any sense to    
  24. you, assume that `configure' did its job and proceed.    
  25. 4. If you need to run the `configure' script more than once (e.g.,    
  26. with some non-default options), always clean the source    
  27. directories before running `configure' again:    
  28. make distclean    
  29. ./configure    
  30. 5. Invoke the `make' program:    
  31. make    
  32. 6. If `make' succeeds, it will build an executable program `emacs'    
  33. in the `src' directory.  You can try this program, to make sure    
  34. it works:    
  35. src/emacs -q    
  36. 7. Assuming that the program `src/emacs' starts and displays its    
  37. opening screen, you can install the program and its auxiliary    
  38. files into their installation directories:    
  39. make install    
  40. You are now ready to use Emacs.  If you wish to conserve disk space,    
  41. you may remove the program binaries and object files from the    
  42. directory where you built Emacs:    
  43. make clean    
  44. You can also save some space by compressing (with `gzip') Info files    
  45. and installed Lisp source (.el) files which have corresponding .elc    
  46. versions.    


4, 那就按他说的做吧:


kk@kk-laptop:~/down/emacs-23.2$ ./configure 

提示:

  1. configure: error: The following required libraries were not found:    
  2. libjpeg libpng libgif/libungif libtiff    
  3. Maybe some development libraries/packages are missing?    
  4. If you don't want to link with them give    
  5. --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no    
  6. as options to configure   



说这几个库没找到:      libjpeg libpng libgif/libungif libtiff
也说可以跳过这几个库 命令是:  ./configure --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no

我是直接跳过了.

安装这几个库:   用 aptitude search 命令查找 libjpeg : 

  1. kk@kk-laptop:~/down/emacs-23.2$ as libjpeg    
  2. v   libjpeg-dbg                     -                                               
  3. v   libjpeg-dev                     -                                               
  4. p   libjpeg-progs                   - Programs for manipulating JPEG files          
  5. i   libjpeg62                       - The Independent JPEG Group's JPEG runtime     
  6. p   libjpeg62-dbg                   - Development files for the IJG JPEG library    
  7. p   libjpeg62-dev                   - Development files for the IJG JPEG library   



得到答案: 要安装 libjpeg-dev , 于是在其它电脑上面下载这个包, 命令 :

  1. aptitude install -d libjpeg-dev  
  2. 读取:1 http://cn.archive.ubuntu.com/ubuntu/ lucid/main libjpeg62-dev 6b-15ubuntu1 [188kB]  
  3. 已下载 188kB,耗时 0秒 (284kB/s)  
  4. cd /var/cache/apt/archives  
  5. kk@kk-laptop:/var/cache/apt/archives$ ls libjpeg*    
  6. libjpeg62-dev_6b-15ubuntu1_i386.deb    



得到 libjpeg62-dev_6b-15ubuntu1_i386.deb

担心这个包还有其它依赖,于是: 

kk@kk-laptop:~/down/emacs-23.2$ aw libjpeg-dev
未发现 libjpeg-dev 的已安装或候选版本
软件包: libjpeg-dev
状态: 不是一个真实的软件包
提供者:: libjpeg62-dev
kk@kk-laptop:~/down/emacs-23.2$ aw libjpeg62-dev
软件包: libjpeg62-dev
状态: 已安装
自动安装: 否
版本号: 6b-15ubuntu1
优先级: 可选
部分: libdevel
维护者: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
未压缩尺寸: 434k
依赖于: libjpeg62 (= 6b-15ubuntu1), libc-dev
提供: libjpeg-dev

需要把 libjpeg62 libc-dev 也装上.
其实把  build-essential 这个包装上,基本上就很全了. 

再搞定 其它几个.
... 我是直接跳过的.  ./configure --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no




然后:

  1. make distclean  
  2. ./configure  
  3. configure: creating ./config.status    
  4. config.status: creating Makefile    
  5. config.status: creating lib-src/Makefile.c    
  6. config.status: creating oldXMenu/Makefile    
  7. config.status: creating doc/emacs/Makefile    
  8. config.status: creating doc/misc/Makefile    
  9. config.status: creating doc/lispintro/Makefile    
  10. config.status: creating doc/lispref/Makefile    
  11. config.status: creating src/Makefile.c    
  12. config.status: creating lwlib/Makefile    
  13. config.status: creating lisp/Makefile    
  14. config.status: creating leim/Makefile    
  15. config.status: creating src/config.h    
  16. config.status: executing default commands    
  17. creating src/epaths.h    
  18. creating lib-src/Makefile    
  19. creating src/Makefile   



OK没报错.



直接执行 make 
看看也没什么错误,

然后执行                  src/emacs -q
成功了, emacs 的普通界面跳出来了. 爽的.
c-x,c-c 退出. 
按照 INSTALL 里的第7步,还要          sudo        make install
debian 系统要加 sudo  不然会提示权限不足.
看看也没什么错误,

然后执行 emacs 
成功了,  emacs 的标准界面跳出来了, 很好很强大.


 

 

  1. kk@kk-laptop:~/down/emacs-23.2$ type emacs    
  2. emacs 已经被散列 (/usr/local/bin/emacs)    
  3. kk@kk-laptop:~/down/emacs-23.2$ file /usr/local/bin/emacs    
  4. /usr/local/bin/emacs: sticky ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped    
  5. kk@kk-laptop:~/down/emacs-23.2$ ls -l /usr/local/bin/emacs    
  6. -rwxr-xr-t 2 root root 10479250 2010-11-17 19:09 /usr/local/bin/emacs   
  7. 需要 rm /u  

 

需要 rm /usr/local/bin/ctags , 这个是emacs 自带的, 要删. 因为我平时用的是另一个 ctags + vim . 汗. 删了这个. 


牛.


转自http://blog.csdn.net/sevk/article/details/6031561

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值