centos7最小安装后,想装tcpdump 无从下手

项目特殊,centos 7最小安装后 不能联网 ,但是需要用到tcpdump 来分析包,我从tcpdump官网上 下载了Libpcap和tcpdump包 ,先装了gcc flex bison glibc 等依赖,先在libpcap目录里./configure,一直过不去,提示
configure: error: flex is insufficient to compile libpcap.
libpcap requires Flex 2.5.31 or later, or a compatible version of lex.

但是 flex我已经装了,
[root@localhost libpcap-1.9.0]# flex --version
flex 2.5.37

一直过不去,求解

https://blog.csdn.net/yhsweetlife/article/details/53022233

#
# Make sure {f}lex supports the -P, --header-file, and --nounput flags
# and supports processing our scanner.l.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for capable lex" >&5
$as_echo_n "checking for capable lex... " >&6; }
if ${tcpdump_cv_capable_lex+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
        tcpdump_cv_capable_lex=yes
    else  
        tcpdump_cv_capable_lex=insufficient
    fi    
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcpdump_cv_capable_lex" >&5
$as_echo "$tcpdump_cv_capable_lex" >&6; }
if test $tcpdump_cv_capable_lex = insufficient ; then
    as_fn_error $? "$LEX is insufficient to compile libpcap.
 libpcap requires Flex 2.5.31 or later, or a compatible version of lex." "$LINENO" 5
fi

在libpcap根目录下执行:

 flex -P pcap_ --header-file=/dev/null --nounput -t ./scanner.l >/dev/null 2>&1; echo $?

如果没返回0,则说明flex不对,升级flex吧