【go】Ubuntu 22.04 LTS golang go-ethereum编译安装

编译go

安装源自带的go 1.18.1

sudo apt install golang-go

编译安装go1.21.6

git clone -b go1.21.6 https://github.com/golang/go
cd go/src
bash make.bash

【go】Ubuntu 22.04 LTS golang go-ethereum编译安装_第1张图片

bin移动到/opt/go1.21.6

mkdir /opt/go1.21.6
sudo cp ~/Downloads/src/go/bin /opt/go1.21.6/ -r

卸载源里面的go1.18.1

sudo apt remove golang-go

编译/etc/profile,末尾新增内容

export PATH=/opt/go1.21.6/bin:/usr/local/cuda/bin:$PATH
export GOROOT=/home/yeqiang/Downloads/src/go

验证版本

编译go-ethereum

下载源码

git clone -b v1.13.0 https://github.com/ethereum/go-ethereum
cd go-ethereum
make all -j6

编译结果

【go】Ubuntu 22.04 LTS golang go-ethereum编译安装_第2张图片

你可能感兴趣的:(ubuntu,golang,ethereum)