Something has gone awry with my ghostscript configuration, whereby I get the following errors when, for example, using 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
I figured out the following workaround (inserted in my .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/'
However, I couldn't find a way of making this setting 'global'. E.g. when say epstopdf is called from export_fig matlab it gives similar errors to above, unless I implement a similar workaround.
I think this has had knock-on effects of stopping printing from working properly on my system.
Ubuntu 16.04
ghostscript, Version: 9.18~dfsg~0-0ubuntu2.6
Any assistance greatly appreciated.
libgs9-common
package? – steeldriver Jun 13 '17 at 12:28sudo dpkg --purge --force-depends libgs9-common
...sudo apt-get install libgs9-common
. Hmm it apears to have fixedepstopdf
but stopped the workaround functioning forgs
. Should I go ahead and purge libgs9-common fully (uninstalling dependencies) then reinstall all the packages? – James Jun 13 '17 at 13:41sudo apt install --reinstall libgs9-common
rather than the lower-leveldpkg
, but I don't know if the outcome would be different. Do you know where the/usr/share/color/icc/ghostscript/
files come from? I can't find a package that provides them (the default color profiles appear to live in/usr/share/ghostscript/9.18/iccprofiles/
) – steeldriver Jun 13 '17 at 13:53/usr/share/ghostscript/9.18/iccprofiles/
as you say. Any other culprit things to try reinstalling? – James Jun 13 '17 at 14:13gs --help
and copy the list ofSearch path
s into your question. Are any relevant environment variables defined (env | grep GS_
)? – steeldriver Jun 13 '17 at 16:51gs --help
. By addingexport GS_LIB=/usr/share/ghostscript/9.18/iccprofiles/
to .bashrc it does appear withgs --help
, as expected. However, bizarrely the error persists exactly as before. – James Jun 14 '17 at 08:37