我的 ghostscript 配置出了问题,例如,使用 epstopdf 时出现以下错误
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1914: gsicc_init_iccmanager(): cannot find default icc profile
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_rgb.icc
| ./base/gsicc_manage.c:1708: gsicc_set_device_profile(): cannot find device profile
**** Unable to open the initial device, quitting.
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1708: gsicc_set_device_profile(): cannot find device profile
Unrecoverable error: unknownerror in .special_op
./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
+ ./base/gsicc_manage.c:2650: gs_setdefaultgrayicc(): cannot find default gray icc profile
我找到了以下解决方法(插入到我的 .bashrc 中)
alias gs='gs -sICCProfilesDir=/usr/share/color/icc/ghostscript/'<br>
alias epstopdf='epstopdf --gsopt=-sICCProfilesDir=/usr/share/color/icc/ghostscript/' <br>
alias ps2pdf='ps2pdf -sICCProfilesDir=/usr/share/color/icc/ghostscript/'
但是,我找不到使此设置“全局”的方法。例如,当从 export_fig matlab 调用 epstopdf 时,它会给出与上述类似的错误,除非我实施类似的解决方法。
我认为这会产生连锁反应,导致我的系统无法正常打印。
Ubuntu 16.04
ghostscript, Version: 9.18~dfsg~0-0ubuntu2.6
非常感谢任何帮助。
答案1
以下是对我有用的方法:
sudo rmdir /usr/share/ghostscript/9.25/iccprofiles
sudo apt-get install --reinstall libgs9-common
某些东西在 处留下了一个空目录/usr/share/ghostscript/9.25/iccprofiles
。似乎会创建一个从到 的libgs9-common
符号链接,但如果文件系统中已有内容,则会默默地无法创建它。/usr/share/ghostscript/9.25/iccprofiles
/usr/share/color/icc/ghostscript