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:
- 清理之前的编译残留:
make clean - 指定imlib2的pkgconfig路径给configure:
./configure --prefix=$HOME/local PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig make && make install - 确保本地库和二进制路径在环境变量中生效,编辑
~/.bashrc或~/.bash_profile添加:
执行export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH export PATH=$HOME/local/bin:$PATHsource ~/.bashrc使配置生效。
临时替代方案
如果暂时不想重新编译,可先尝试保存为其他支持的格式:
- 保存为JPG:
scrot test.jpg - 保存为PPM后转PNG:
scrot test.ppm && convert test.ppm test.png(需自行编译安装ImageMagick到本地目录)
内容的提问来源于stack exchange,提问作者Soon
相关产品推荐
相关产品推荐

