安装golang,protobuf Linux教程



1.安装protobuf:

https://github.com/protocolbuffers/protobuf/releases

https://github.com/google/googletest/releases

tar -xzf protobuf-all-3.6.1.tar.gz
cd /data/file/soft/src/protobuf-3.6.1
tar xzvf release-1.8.1.tar.gz
mv googletest-release-1.8.1 gtest
./autogen.sh
./configure --prefix=/usr/local/protobuf
make 
make check 
make install


2.安装golang: https://golang.google.cn/dl/  or  https://studygolang.com/dl

apt-get remove golang  # 卸载旧版本
apt-get autoremove
cd /data/file/soft/src
tar -zxvf go1.11.linux-amd64.tar.gz -C /usr/local/


3.修改系统变量:

vi /etc/profile
export PATH=$PATH:/usr/local/protobuf/bin/
export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig/
export PATH=$PATH:/usr/local/go/bin
source /etc/profile
go version

配置动态链接库路径

vi /etc/ld.so.conf
/usr/local/protobuf/lib # 增加
ldconfig


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回