linux configure: error: no acceptable C compiler found in $PATH

前言

Linux 上安装 pgsql时,执行 ./configure --prefix=/usr/local/pgsql 报错,同以下:

[root@instance-0qymp8uo postgresql-14.1]# ./configure --prefix=/usr/local/pgsql
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... no
checking for cc... no
configure: error: in `/root/postgresql-14.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

这里的报错原因为,找不到合适的 C 编译器,我们需要更新一下 gcc

./configure 是用来检测你的安装平台的目标特征,这一步用来生成 Makefile,为下一步的编译做准备,–prefix= 为指定软件安装目录,一些软件的配置文件你可以通过指定 –sys-config= 参数进行设定。有一些软件还可以加上 –with–enable–without–disable 等等参数对编译加以控制,你可以通过允许 ./configure –help 查看详细的说明帮助。

解决方案

Centos

 yum install gcc

Ubuntu

apt-get install gcc
原文地址:https://www.cnblogs.com/niuben/p/15698677.html