损坏的 ghostscript 配置

Jam*_*mes 10 ghostscript 16.04

我的 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
Run Code Online (Sandbox Code Playgroud)

我想出了以下解决方法(插入到我的 .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/'
Run Code Online (Sandbox Code Playgroud)

但是,我找不到使此设置“全局”的方法。例如,当从 export_fig matlab 调用 epstopdf 时,它会给出与上述类似的错误,除非我实现了类似的解决方法。

我认为这对停止打印在我的系统上正常工作产生了连锁反应。

Ubuntu 16.04  
ghostscript, Version: 9.18~dfsg~0-0ubuntu2.6
Run Code Online (Sandbox Code Playgroud)

非常感谢任何帮助。

小智 22

以下是对我有用的内容:

sudo rmdir /usr/share/ghostscript/9.25/iccprofiles
sudo apt-get install --reinstall libgs9-common
Run Code Online (Sandbox Code Playgroud)

某些东西在 上留下了一个空目录/usr/share/ghostscript/9.25/iccprofiles。似乎libgs9-common/usr/share/ghostscript/9.25/iccprofilesto创建符号链接/usr/share/color/icc/ghostscript,但如果文件系统中已经存在某些内容,则无法创建它。

  • 在 18.04 也为我工作。 (6认同)