1. 安装依赖
yum install gmp-devel mpfr-devel libmpc-devel -y
2. 安装gcc
2.1 离线环境
wget https://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.gz
tar -xzf gcc-10.3.0.tar.gz
-
编译安装
yum -y install gcc c++ --skip-broken
./configure --disable-multilib --enable-languages=c,c++
make
sudo make install
2.2 在线环境
# CentOS/RHEL系统:
sudo yum update
sudo yum groupinstall 'Development Tools'
# Ubuntu/Debian系统:
sudo apt-get update
sudo apt-get install build-essential
3. 安装jq
下载:https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz
tar -zxvf jq-1.5.tar.gz
cd jq-1.5
./configure && make && make install
-
测试
echo '{"id":1,"name":"zhangsan"}' | jq .
4. rpm包安装
下载地址:https://rhel.pkgs.org/7/atomic-x86_64/jq-1.6-2.el7.x86_64.rpm.html
yum install -y oniguruma-6.8.2-2.el7.x86_64.rpm
yum install -y jq-1.6-2.el7.x86_64.rpm