How to Install libgdiplus Library on CentOS and Amazon Linux
Environment
Product | Progress® Telerik® Reporting |
Operating System | Linux |
Description
Learn how to find the repository to download and install libgdiplus
on CentOS and its derived Amazon Linux operating system.
Solution
The libgdiplus
library for CentOS Linux distributions resides in the Epel
package repository. For most of the CentOS versions this repository is available by default. Amazon Linux is based on CentOS but not all of its versions contain Epel
by default. Below are the commands necessary for installing this repository. Note that they may vary depending on the exact distribution, version, etc. You may need to run the terminal as administrator, or use sudo
to authorize.
yum install epel-release -y
# Note: if 'yum install epel-release' doesn't work for you, try manually update the source
# rpm -ihv --nodeps https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
After successfully installing the repository with the above instructions, you may assure that you have the Epel
repository listed with the output from the following command:
yum repolist
If it is indeed available, you may run the below command and install the package itself:
yum install libgdiplus
Known issues related to the libgdiplus
on CentOS
An exception with the following stack trace may occur in some cases:
Unhandled exception. System.TypeInitializationException: The type initializer for 'Telerik.Reporting.Processing.Common.FontContainer' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
at Interop.Libdl.dlopen(String fileName, Int32 flag)
at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
--- End of inner exception stack trace ---
at System.Drawing.SafeNativeMethods.Gdip.GdipNewPrivateFontCollection(IntPtr& fontCollection)
at System.Drawing.Text.PrivateFontCollection..ctor()
at Telerik.Reporting.Processing.Common.FontContainer..ctor()
at Telerik.Reporting.Processing.Common.FontContainer..cctor()
--- End of inner exception stack trace ---
at Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(ReportSource reportSource, IRenderingContext context)
at Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(ReportSource reportSource, Hashtable deviceInfo, IRenderingContext context)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.<>c__DisplayClass47_0.<RenderReport>b__0(SingleStreamManager sm)
at Telerik.Reporting.Processing.ReportProcessor.RenderReportSafe(Func`2 renderCallback, String format, IRenderingContext renderingContext)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo, CancellationToken cancellationToken)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
at Program.<Main>$(String[] args) in /home/projects/ConsoleApp1/ConsoleApp1/Program.cs:line 10
If you see the error, run the next command to fix it:
ln -s /lib64/libdl.so.2 /lib64/libdl.so