CentOS7安装libevent时configure报错无法创建临时文件求助
问题场景
在CentOS 7中安装libevent-2.1.12-stable,执行以下操作时:
mkdir -p /opt/libevent cd /opt/libevent tar -zxvf libevent-2.1.12-stable.tar.gz cd libevent-2.1.12-stable ./configure --prefix=/usr/local/libevent
出现错误:
checking that generated files are newer than configure... done configure: creating ./config.status ./configure: line 19401: cannot create temp file for here-document: No such file or directory configure: error: write failure creating ./config.status
查看configure脚本19401行内容为:
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
且$CONFIG_STATUS变量值为空。
解决方法
- 检查当前目录写入权限:执行
touch test_config_status尝试创建文件,如果失败,确认/opt/libevent-2.1.12-stable目录是否为只读挂载,可通过mount | grep /opt查看挂载属性,若为只读则重新挂载为读写模式。 - 修复临时目录(/tmp)状态:
- 执行
df -h /tmp检查/tmp目录磁盘空间是否已满,若已满清理无用文件释放空间。 - 执行
ls -ld /tmp查看权限,正常应为drwxrwxrwt,若权限异常,执行chmod 1777 /tmp修复。
- 执行
- 手动指定CONFIG_STATUS变量运行configure:直接在命令中指定变量值,执行:
CONFIG_STATUS=./config.status ./configure --prefix=/usr/local/libevent - 检查系统磁盘剩余空间:执行
df -h查看所有挂载点的剩余空间,若存在磁盘满的情况,清理对应分区的无用文件。 - 重新解压源码包:删除当前损坏的源码目录,重新解压:
rm -rf libevent-2.1.12-stable tar -zxvf libevent-2.1.12-stable.tar.gz cd libevent-2.1.12-stable ./configure --prefix=/usr/local/libevent
内容的提问来源于stack exchange,提问作者Up Pu
相关产品推荐
相关产品推荐

