vps交流

Nginx编译ngx_brotli老是出现奇奇怪怪的问题


Nginx编译ngx_brotli老是出现奇奇怪怪的问题

运维阿宏 管理员 发表于 4 小时前 | 只看该作者
您好,服务器命令行执行以下命令安装依赖后再试试

  1. apt-get install gcc gcc-c++ gcc-g77

复制代码

  1. [email protected]:~# apt-get install gcc gcc-c++ gcc-g77
  2. Reading package lists… Done
  3. Building dependency tree… Done
  4. Reading state information… Done
  5. E: Unable to locate package gcc-c+
  6. E: Couldn’t find any package by regex ‘gcc-c+’
  7. E: Unable to locate package gcc-g77

复制代码

  1. [email protected]:~# apt update
  2. Hit:1 https://mirrors.cloud.tencent.com/debian buster InRelease
  3. Get:2 https://mirrors.cloud.tencent.com/debian buster-updates InRelease [51.9 kB]
  4. Get:3 https://mirrors.cloud.tencent.com/debian buster-backports InRelease [46.7 kB]
  5. Get:4 https://mirrors.cloud.tencent.com/debian-security buster/updates InRelease [65.4 kB]
  6. Fetched 164 kB in 1s (173 kB/s)
  7. Reading package lists… Done
  8. Building dependency tree… Done
  9. Reading state information… Done
  10. All packages are up to date.
  11. [email protected]:~# apt install -y make cmake gcc gcc-c++ gcc-g77 autoconf automake
  12. Reading package lists… Done
  13. Building dependency tree… Done
  14. Reading state information… Done
  15. E: Unable to locate package gcc-c+
  16. E: Unable to locate package gcc-g77

复制代码

没有看到奇怪的问题
ngx_brotli从github拉:
git clone https://github.com/google/ngx_brotli.git
cd  ngx_brotli
git submodule update –init
cd ..
gcc相关:
#gcc
yum -y install centos-release-scl && yum -y install centos-release-scl devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils && scl enable devtoolset-7 bash
#需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
#如果要长期使用gcc 7.3的话:
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile
上述命令基于centos7-1810 其他系统自行替换
腾讯云的源需要腾讯自己的DNS才能在正常,你可定更换腾讯的默认DNS了