You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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)状态:
    1. 执行df -h /tmp检查/tmp目录磁盘空间是否已满,若已满清理无用文件释放空间。
    2. 执行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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 11:48:24