Broken ghostscript configuration
Here's what worked for me:
sudo rmdir /usr/share/ghostscript/9.25/iccprofiles
sudo apt-get install --reinstall libgs9-common
Something had left an empty directory at /usr/share/ghostscript/9.25/iccprofiles
. It appears that libgs9-common
creates a symlink from /usr/share/ghostscript/9.25/iccprofiles
to /usr/share/color/icc/ghostscript
, but silently fails to create it if there's already something in the filesystem.
Related videos on Youtube
James
Updated on September 18, 2022Comments
-
James over 1 year
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.
-
steeldriver almost 7 yearsComplete SWAG - but have you tried re-installing the
libgs9-common
package? -
James almost 7 yearsI did this with
sudo 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? -
steeldriver almost 7 yearsI don't know . . . I would have tried
sudo 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/
) -
James almost 7 yearsReinstalling via apt was the same. The workaround needed updating to
/usr/share/ghostscript/9.18/iccprofiles/
as you say. Any other culprit things to try reinstalling? -
steeldriver almost 7 yearsPlease run
gs --help
and copy the list ofSearch path
s into your question. Are any relevant environment variables defined (env | grep GS_
)? -
James almost 7 yearsBy default no icc-file-containing location shows up in the search path list for
gs --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 almost 7 yearsLet us continue this discussion in chat.
-
Tobias over 5 yearsI have exactly the same problem. Did you find a way to fix it?
-
-
randomuser15995183 over 5 yearsWorked for me too, in 18.04.
-
Andrea Lazzarotto over 5 yearsAmazing. I had printing completely broken on Ubuntu 18.04 and then on 18.10, then I realized Evince couldn't open PS files. Your solution works perfectly.
-
cvhberger over 5 yearsVille, worked for me too! Thank you very much indeed! Was having problems with cups-pdf not printing into ~/PDF; turned out gs was failing with code 255 (thanks Volker for pointing that out) and to you for your recipe as it finally brought gs back from a broken state.