- 安裝比特幣需要的所有庫
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 sudo apt-get install libboost-all-dev
- GUI:關於QT的各種庫
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
出現了錯誤,有些包無法下載:

解決方法:參考 https://blog.csdn.net/tiny_lxf/article/details/75027865
sudo vim /etc/resolv.conf 修改 nameserver 8.8.8.8
再次運行上面的GUI安裝,成功
- git源碼
sudo apt-get install git
git clone https://github.com/bitcoin/bitcoin.git
- 安裝Berkeley DB:推薦使用Berkeley DB 4.8
cd bitcoin ./contrib/install_db4.sh `pwd`
- 配置
./autogen.sh ./configure
出現報錯:原因是找不到berkeleyDB的相關頭文件導致的(參考 https://blog.csdn.net/xocoder/article/details/78914576)
報錯:libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (–disable-wallet to disable wallet functionality)
上面安裝db的腳本執行后其實會提示:
When compiling bitcoind, run `./configure` in the following way:
export BDB_PREFIX='/home/zhang/bitcoin/db4'
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...
所以,應當設置bash環境變量BDB_PREFIX為剛才指定的安裝目錄,並在configure時,提供這個環境變量
解決步驟:
vim ~/.bashrc
export BDB_PREFIX='/home/zhang/bitcoin/db4'
source ~/.bashrc
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
- 編譯
make make install
出現錯誤:
[install-libLTLIBRARIES] Error 1
[install-recursive] Error 1
解決方法:
sudo make install
- 測試
$ which bitcoind /usr/local/bin/bitcoind $ which bitcoin-cli /usr/local/bin/bitcoin-cli
bitcoind bitcoin-qt bitcoin-cli
or
./src/bitcoind
./src/qt/bitcoin-qt
./src/bitcoin-cli

安裝過程參考:
https://blog.csdn.net/u011609555/article/details/79660086
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
https://blog.csdn.net/aaadssdffff/article/details/52992688
