MATLAB: Do I get the error libpng.so: No such file or directory when adding exceptions to SELinux for MATLAB

MATLAB

I have SELinux enabled and I cannot run MATLAB. I am trying to add the appropriate exceptions so MATLAB will run. I run something like the following:
chcon -t texrel_shlib_t /usr/local/MATLAB/R2011b/bin/glnx86/*.so
When doing so I get the following error:
chcon: /usr/local/MATLAB/R2011b/bin/glnx86/libpng.so: No such file or directory
How do I get around this error?

Best Answer

This seems to be due to the softlink for the libpng.so:
ls -la libpng.so
libpng.so -> libpng12.so
Change the symbolic link from this file to the other version of the library in this folder. The name of this file may be different for other releases. For example, R2011b on 32-bit Linux:
cd /usr/local/MATLAB/R2011b/bin/glnx86/
ln -s -f libpng12.so.0.39.0 libpng.so
Then try this command again:
chcon -t texrel_shlib_t /usr/local/MATLAB/R2011b/bin/glnx86/*.so*
Continue to run the commands that SELinux suggests to allow MATLAB to start with this program enabled.
Note that MathWorks doesn't support SELinux and we are in a limited position to offer workarounds and suggestions for this program.
Related Question