cuteftp 2018-2-13 23:23
如何在CentOS7 下安裝聊天軟體 telegram-cli
<div>Telegram是一款加密通信的聊天軟體,可以在linux,windows,android,chrome等運行。</div><div><br></div><div>要安裝 telegram-cli 之前需要先裝一些套件</div><div><br></div><div>安裝 libevent-devel</div><div># rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/libevent-devel-2.0.21-4.el7.x86_64.rpm</div><div><br></div><div>安裝 libconfig 跟 libconfig-devel</div><div># yum install libconfig</div><div># rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/libconfig-devel-1.4.9-5.el7.x86_64.rpm</div><div><br></div><div>安裝 lua-devel</div><div># rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/lua-devel-5.1.4-15.el7.x86_64.rpm</div><div><br></div><div>安裝 libjansson-devel</div><div># yum install jansson</div><div># rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/jansson-devel-2.10-1.el7.x86_64.rpm</div><div><br></div><div>再來安裝 tg.git</div><div># git clone --recursive https://github.com/vysheng/tg.git && cd tg</div><div># ./configure</div><div># make</div><div><br></div><div>如果沒意外應該就可以裝好了...</div><div><br></div><div>這個時候,當前目錄會生成一個bin/目錄。</div><div><br></div><div># ls bin/</div><div>generate telegram-cli tl-parser</div><div><br></div><div>現在只需要把它們方到$PATH包含的目錄裡即可,我方到了我的~/.local/bin/下了。</div><div><br></div><div># cp bin/* ~/.local/bin/</div><div><br></div><div>然後還需要將當前目錄的server.pub複製到/etc/telegram-cli/目錄下。</div><div><br></div><div># sudo mkdir /etc/telegram-cli/</div><div># sudo cp server.pub /etc/telegram-cli/</div><div><br></div><div>現在一切已經安裝好了,只需要允許telegram-cli即可</div><div><br></div><div># telegram-cli</div><div><br></div><div>第一次運行會提示你輸入phone,first name,last name。注意輸入的phone為+86123xxxxx。</div><div><br></div><div>現在需要發送消息等可以查看幫助。</div><div><br></div><div>> help</div><div><br></div><div>或者查看wiki:https://github.com/vysheng/tg/wiki</div><div><br></div><div>裡面有telegram-cli附帶的參數說明,登錄後help中的命令說明,以及sysv和systemd下開機啟動為daemon模式設置。<br><br>參考資料:<br>https://github.com/vysheng/tg<br>http://www.cnblogs.com/liuxuzzz/p/5313907.html<br></div>