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

RHEL7.9无sudo权限下scrot截图报错“No saver for file format”求助

解决scrot无法保存PNG截图的问题

检查imlib2的PNG支持

先确认你手动安装的imlib2是否启用了PNG格式支持:

  • 执行 imlib2-config --formats,查看输出中是否包含png。如果没有,说明编译imlib2时未正确关联已安装的libpng,需重新编译:
    ./configure --prefix=$HOME/local --with-libpng=$HOME/local
    make && make install
    
    注意替换$HOME/local为你实际的本地软件安装目录。

重新编译scrot并关联本地imlib2

若imlib2已支持PNG,问题大概率出在scrot编译时未找到你本地安装的imlib2,需重新编译scrot:

  1. 清理之前的编译残留:
    make clean
    
  2. 指定imlib2的pkgconfig路径给configure:
    ./configure --prefix=$HOME/local PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig
    make && make install
    
  3. 确保本地库和二进制路径在环境变量中生效,编辑~/.bashrc或~/.bash_profile添加:
    export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
    export PATH=$HOME/local/bin:$PATH
    
    执行 source ~/.bashrc 使配置生效。

临时替代方案

如果暂时不想重新编译,可先尝试保存为其他支持的格式:

  • 保存为JPG:scrot test.jpg
  • 保存为PPM后转PNG:scrot test.ppm && convert test.ppm test.png(需自行编译安装ImageMagick到本地目录)

内容的提问来源于stack exchange,提问作者Soon

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.30 04:19:53