Centos中 安装 perl, m4, autoconf,automake

本文详细介绍了在Centos中搭建swoole运行环境前,如何安装automake, autoconf及其依赖perl和m4的过程。包括下载源码包、配置安装路径、编译和安装等步骤,并解决了在安装过程中遇到的make、configure等命令的报错问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Centos中本来准备搭建swoole运行环境,发现需要先提前安装automake, autoconf,所以记录下安装过程。
注:在安装过程中发现automake,autoconf存在依赖关系,automake->autoconf->perl & m4,故我的安装顺序: perl->m4->autoconf->automake

make 报错:Failed to search for file: Cannot update read-only repo
#安装make命令的命令 yum -y install gcc automake autoconf libtool make

#查看是否安装成功(在Xshell下) make -v

一、安装perl(yum -y install perl perl-devel)
1.下载安装包 wget http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz
2. 解压安装包 tar -zxvf perl-5.26.1.tar.gz
3. 进入安装目录 cd perl-5.26.1
4. 编译并安装 make && make install
5. 验证 perl -v,如下图则安装成功
在这里插入图片描述
二、安装m4
1.下载安装包 wget http://mirrors.kernel.org/gnu/m4/m4-1.4.18.tar.gz
2. 解压安装包 tar -xzvf m4-1.4.18.tar.gz
3. 进入安装目录 cd m4-1.4.18
4. 配置安装目录 ./configure --prefix=/usr/local
5. 编译并安装 make && make install
6. 编译并安装 m4 --version
在这里插入图片描述
在CentOS 8.1中,configure 会报如下图错误
解决方法 yum install gcc,安装gcc即可
在这里插入图片描述
在CentOS 8.1 make的时候会报如下图错误
在这里插入图片描述
解决方法 NUC980开源项目24-Please port gnulib freadahead.c to your platform

sed -i ‘s/IO_ftrylockfile/IO_EOF_SEEN/’ lib/*.c
echo “#define _IO_IN_BACKUP 0x100” >> lib/stdio-impl.h

三、安装autoconf
1.下载安装包 wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.gz
2. 解压安装包 tar -xzvf autoconf-2.69.tar.gz
3. 进入安装目录 cd autoconf-2.69
4. 配置安装目录 ./configure --prefix=/usr/local
5. 编译并安装 make && make install
6. 编译并安装 autoconf --version
在这里插入图片描述
执行step 5,可能会报如下错误:
Can’t locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5……
提示这个是缺失perl 的插件,可以通过yum的方式来安装下插件.yum install 'perl(Data::Dumper)'
在这里插入图片描述
四、安装automake
1.下载安装包 wget http://mirrors.kernel.org/gnu/automake/automake-1.16.tar.gz
2. 解压安装包 tar xzvf automake-1.16.tar.gz
3. 进入安装目录 cd automake-1.16
4. 配置安装目录 ./configure --prefix=/usr/local
5. 编译并安装 make && make install
6. 编译并安装 automake --version
在这里插入图片描述
执行step5,可能会报错:
help2man: can’t get `–help’ info from automake-1.16……
在这里插入图片描述
解决办法:可以通过vi Makefile,在3694行的末尾加上 --no-discard-stderr
在这里插入图片描述
执行step5, 可能会报错
Can’t locate Thread/Queue.pm in @INC (@INC contains: /usr/share/automake-1.15 /usr/local/lib64/perl5 ……
在这里插入图片描述
解决办法:缺少perl环境依赖 “perl-Thread-Queue”,下载并安装 yum install perl-Thread-Queue
执行step5,可能会报错
“none” is not exported by the “List::Util module”
Can’t continue after import errors at ./bin/automake line 76
在这里插入图片描述
解决办法:vi /usr/local/bin/automake 第76行,将use List::Util ‘none’; 改为 use List::Util;
在这里插入图片描述

参考文档:
CentOS7.4 安装 perl 环境
RPM 安装 mysql 出现 Can‘t locate Data/Dumper.pm in @INC (@INC contains
Help2man: can’t get `–help’ info from automake-1.16
Centos7安装autoconf常见错误解决办法
automake --version报错
Linux下的Autoconf和AutoMake

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值