ubuntu 安装thrift

    xiaoxiao2021-03-25  60

    一、更新apt-get 源为阿里云的软件源

    1、复制原文件备份

    sudo cp /etc/apt/sources.list  /etc/apt/sources.list.bak

    2、编辑源列表文件

    sudo vim /etc/apt/sources.list

    3、将原来的列表删除,添加如下内容

    deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse

    4、运行sudo apt-get update

    5、运行sudo apt-get upgrade

    二.安装相关依赖包

    1、 sudo apt-get install libboost-dev libboost-dbg libboost-doc 

    2、

    sudo apt-get install libboost-test-dev

    3、sudo apt-get install libevent-dev automake libtool flex bison  g++ libssl-dev 

    三.下载thrift

    wget  http://mirrors.hust.edu.cn/apache/thrift/0.10.0/thrift-0.10.0.tar.gz 

    四.安装thrift

    tar -zxvf thrift-0.10.0.tar.gz

    cd thrift-0.10.0

    ./configure

    make && make install

    thrift 0.10.0 Building Plugin Support ...... : yes Building C++ Library ......... : yes Building C (GLib) Library .... : no Building Java Library ........ : no Building C# Library .......... : no Building Python Library ...... : yes Building Ruby Library ........ : no Building Haxe Library ........ : no Building Haskell Library ..... : no Building Perl Library ........ : no Building PHP Library ......... : no Building Dart Library ........ : no Building Erlang Library ...... : no Building Go Library .......... : no Building D Library ........... : no Building NodeJS Library ...... : no Building Lua Library ......... : no C++ Library:    Build TZlibTransport ...... : yes    Build TNonblockingServer .. : yes    Build TQTcpServer (Qt4) .... : no    Build TQTcpServer (Qt5) .... : no Python Library:    Using Python .............. : /usr/bin/python    Using trial ............... : /usr/bin/trial

    五、修改目录

    修改/etc/ld.so.conf,然后刷新,好处是比较不受用户的限制

        这个没有修改LD_LIBRARY_PATH但是效果是一样的实现动态库的查找, 

        1. /etc/ld.so.conf下面加一行/usr/local//lib

        2. ldconfig

    六、查看thrift版本

    root@-VirtualBox thrift -version Thrift version 0.10.0

    转载请注明原文地址: https://ju.6miu.com/read-39185.html

    最新回复(0)