$sudo yum install -y boost-devel qt-devel protobuf-devel qrencode-devel libevent-devel libtool openssl-devel glibc-headers gcc-c++ $mkdir /app/Workdir $git clone https://github.com/litecoin-project/litecoin.git 或直接下载最新源代码: $wget https://github.com/litecoin-project/litecoin/archive/master.zip $cd /app/litecoin download the berkeley-db http://download.oracle.com/otn/berkeley-db/db-6.2.32.NC.tar upzip the package $tar -xf db-6.2.32.NC.tar $cd db-6.2.32.NC/build_unix/ $../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local $sudo make install build the litecoin $cd ~/Workdir/litecoin $sh autogen.sh $sudo ./configure --with-incompatible-bdb --with-gui=no --prefix=/app/litecoinapp $make 这里如果报错,就需要升级gcc版本。 报错信息: ./amount.h:123:73: error: can't initialize friend function 'operator*' friend constexpr Amount operator*(const double a, const Amount b) = delete; GCC升级 # yum install centos-release-scl -y # yum install devtoolset-4-toolchain -y # scl enable devtoolset-4 bash # gcc --version 如果编译还是出上面的错,就执行 scl enable devtoolset-4 bash 如下报错信息,需要升级Boost版本。https://github.com/Bitcoin-ABC/bitcoin-abc/pull/124 test/cashaddrenc_tests.cpp:196:29: error: no match for ‘operator!=’ (operand types are ‘CTxDestination {aka boost::variant}’ and ‘const CTxDestination {aka const boost::variant}’) http://www.boost.org 下载最新版本boost tar -xf boost.tar.gz cd boost_1_67 sudo ./bootstrap.sh --prefix=/usr/local/include/boost sudo ./b2 --build-type=complete --layout=tagged install 编译完毕后配置路径 $ sudo mv /usr/include/boost/ /usr/include/boost.backup $ sudo mv /usr/lib64/libboost_* ./boost.backup/ $ sudo mv /usr/local/include/boost/include/boost/ /usr/include/ $ sudo mv /usr/local/include/boost/lib/libboost_* /usr/lib64/ $sudo make install 会报一堆告警信息,但是不用理会,最终运行echo $?,看一眼有没有报错即可,如果显示0,就是没报错 安装完毕后,会在cd /usr/local/litecoin/bin/目录下,多出几个文件,分别是莱特币的运行文件和测试文件,这里,我们运行测试文件./test_litecoin,来测试安装是否完整 $cd /usr/local/litecoin/bin/ $./test_litecoin