1 下載
2 安裝Goland
1.解壓並重命名目錄
~$ tar -zxvf goland-2019.1.3.tar.gz -C /usr/local
~$ sudo mv /usr/local/GoLand-2019.1.3/ /usr/local/GoLand
~$ ll /usr/local/
total 48
drwxr-xr-x 12 root root 4096 7月 23 17:08 ./
drwxr-xr-x 10 root root 4096 2月 10 08:12 ../
drwxr-xr-x 2 root root 4096 2月 10 08:12 bin/
drwxr-xr-x 2 root root 4096 2月 10 08:12 etc/
drwxr-xr-x 2 root root 4096 2月 10 08:12 games/
drwxr-xr-x 10 root root 4096 7月 9 05:29 go/
drwxr-xr-x 8 root root 4096 7月 23 17:06 GoLand/
drwxr-xr-x 2 root root 4096 2月 10 08:12 include/
drwxr-xr-x 3 root root 4096 6月 30 00:32 lib/
lrwxrwxrwx 1 root root 9 6月 29 23:43 man -> share/man/
drwxr-xr-x 2 root root 4096 2月 10 08:12 sbin/
drwxr-xr-x 6 root root 4096 2月 10 08:15 share/
drwxr-xr-x 2 root root 4096 2月 10 08:12 src/
配置爲全局啓動
將GoLand的啓動腳本goland.sh加入用戶的/usr/bin/目錄下,可以在任意位置執行goland.sh啓動GoLand IDE。
~$ cd /usr/local/GoLand/bin/
~$ sudo ln -s $(pwd)/goland.sh /usr/bin/goland.sh
配置啓動命令別名並獨立運行
按照步驟2中的方式啓動GoLand之後,必須保持啓動GoLand的terminal保持active,否則GoLand也會隨之退出。因此,通過重命名alias的方式簡化啓動命令,並獨立運行(不隨terminal關閉而退出)。
打開.bashrc並定義別名:
~$ vim .bashrc
...
alias goland='nohup goland.sh & >/dev/null'
然後重新打開一個terminal,直接輸入goland回車即可啓動。