破坏的ghostscript配置

我的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/'
alias epstopdf='epstopdf --gsopt=-sICCProfilesDir=/usr/share/color/icc/ghostscript/'
alias ps2pdf='ps2pdf -sICCProfilesDir=/usr/share/color/icc/ghostscript/'

但是,我找不到让这种设置“全球化”的方法。 例如,当从export_fig matlab调用epstopdf时,它会给出类似的错误,除非我实现了类似的解决方法。

我认为这有阻止打印在我的系统上正常工作的连锁效应。

 Ubuntu 16.04 ghostscript, Version: 9.18~dfsg~0-0ubuntu2.6 

非常感谢任何帮助。

这对我有用:

 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的符号链接,但是如果文件系统中已有某些内容,则无法创建它。