本文介紹了如何在Ubuntu下編譯安裝Atom編輯器,包含安裝過程和安裝常見問題,供需要的同學參考。
目錄
安裝前工作
官方推薦環境
安裝常見問題
no such option –no-parallel 錯誤
atom安裝位置
atom 運行錯誤cannot open shared object file libudev.so.0
參考鏈接
看到了Atom編輯器可以下載使用的消息(http://www.linuxidc.com/Linux/2014-05/101416.htm),打開一看只提供Mac版的安裝包。於是去Github上看了看,發現可以在Linux平台下編譯安裝,步驟也比較簡單,於是決定在Ubuntu上折騰一番,體驗一下。
先上一張運行效果圖:
sudo apt-get install libgnome-keyring-dev
npm config set python /usr/bin/python2 -g
確保使用Python2然後按照官方的教程依次執行下面代碼
git clone https://github.com/atom/atom
cd atom
script/build //Creates application at /tmp/atom-build/Atom
sudo script/grunt install //Installs command to /usr/local/bin/atom
整個源文件有200多兆,下載速度因網絡而異,下載完成後進行編譯,不出意外的話,過個20分鐘左右你就可以使用atom了。
在終端中直接輸入atom
即可。
我的Ubuntu是14.04 64bit,安裝的過程中出現了點小問題。
解決辦法是直接將atom/build/node_modules/npm/node_modules/node-gyp/lib/configure.js
文件中316行左右的//argv.push('--no-parallel')
注釋掉;或者升級gyp
。推薦前者
atom默認是安裝在/user/local/bin
下的,如果想要修改安裝位置,可以添加INSTALL_PREFIX
環境變量來修改安裝位置或者直接修改build/Gruntfile.coffee
文件中68行左右的installDir = process.env.INSTALL_PREFIX ? '/usr/local'
的值。
cannot open shared object file libudev.so.0
我運行的時候出現了這個錯誤,經過Google找了解決方法:
對於32位系統:
sudo ln -sf /lib/i386-linux-gnu/libudev.so.1 /lib/i386-linux-gnu/libudev.so.0
對於64位系統:
sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
以上就是我安裝過程中遇到的一些問題,僅供參考。
Enjoy!
How do I resolve a “Cannot open shared object file libudev.so.0” error?
gyp_main.py: error: no such option: –no-parallel
更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2