Short answer: wkhtmltoimage is starting with a dependency on the versioned ICU library libicui18n.so.42, but your system’s dynamic loader cannot find that exact file. Identify the executable, Linux release and architecture, then install the ICU runtime that matches that binary—or replace the binary with a build made for your system. Do not create a guessed symlink from another ICU version.
What the error means
The literal failure is usually:
wkhtmltoimage: error while loading shared libraries: libicui18n.so.42: cannot open shared object file: No such file or directory
This happens before a page is rendered. The executable was linked against ICU’s internationalization component with the soname libicui18n.so.42. At startup, the Linux loader searches its configured library paths, does not find that name, and stops.
A Stack Overflow report describes this exact message for /usr/bin/wkhtmltoimage on CentOS 6.6, where the Ruby imagekit gem and the wkhtmltoimage-binary package were involved. That is a historical example, not a universal recipe for current Linux installations. Package names and available ICU versions differ by distribution release and CPU architecture.
First, confirm which wkhtmltoimage you are running
Wrappers and language packages can install a private executable that is different from the one you expect. Resolve the command before changing packages.
#1 Best Overall
command -v wkhtmltoimage
readlink -f "$(command -v wkhtmltoimage)"
wkhtmltoimage --version
If your application invokes an absolute path, inspect that path instead. For a Ruby application, check the gem’s installation path and the command configured by the application. The important question is which binary actually requests libicui18n.so.42.
Identify the host before installing anything
Record the distribution, release, architecture and configured repositories. These details determine whether the requested ICU runtime is available and which package supplies it.
cat /etc/os-release
uname -m
getconf LONG_BIT
On systems that provide them, package-manager queries can show installed ICU components and repository candidates. Use your distribution’s official documentation for the exact package name and command; the evidence for this error does not establish one command that works on every Linux release.
- RPM-based systems: query installed packages and repository metadata with the package tools supplied by that release.
- Debian-based systems: inspect installed ICU packages and available versions with the distribution’s package tools.
- Container or minimal images: verify that the configured repositories actually contain runtime libraries; a full desktop installation and a slim image often differ.
Inspect the binary’s dynamic dependencies
Use ldd to see whether the executable requests the missing soname and whether other dependencies are also unresolved.
Recommended Free Tools
BIN="$(readlink -f "$(command -v wkhtmltoimage)")"
ldd "$BIN" | grep -E 'icu|not found'
A line such as libicui18n.so.42 => not found confirms that this binary specifically needs that soname. If several lines end in not found, fixing ICU alone will not complete the installation.
Check the loader’s visible cache and common library directories:
Rank #2
ldconfig -p | grep icui18n
find /lib /lib64 /usr/lib /usr/lib64 -name 'libicui18n.so*' 2>/dev/null
Directory layouts vary, so treat these paths as diagnostic examples rather than a promise that every system uses them. If the exact .so.42 file exists outside the loader’s configured paths, consult your distribution’s library-path documentation instead of adding an arbitrary global path.
Choose one of the two supported remediation paths
Path A: install the matching ICU runtime
Use the operating system’s supported repository to install the runtime package that provides libicui18n.so.42 for your release and architecture. A commenter on the historical report suggested a libicu package and an ICU RPM, but the comment was uncertain about its source. Treat it as a lead to verify, not as an authoritative package name.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
A Broadcom support article about a different application also recommends installing an ICU package when ICU dependencies are unresolved. That supports the general package-based approach, but it does not identify the correct wkhtmltoimage package for your distribution.
After installation, refresh the loader cache if your package manager does not do so automatically, then verify:
ldconfig -p | grep 'libicui18n.so.42'
ldd "$BIN" | grep 'not found' || true
wkhtmltoimage --version
Do not assume success merely because the ICU line disappeared. Run the complete ldd check and then a real capture; another missing library may be reported next.
Path B: replace wkhtmltoimage with a compatible build
If your current repositories do not provide the requested ICU soname—or the binary came from an old gem, copied archive or obsolete operating-system build—use a wkhtmltoimage build intended for your host’s distribution and architecture. Compare:
Rank #3
- the binary’s required ICU sonames;
- your Linux release and CPU architecture;
- the package or build’s maintenance and repository status;
- all remaining shared-library dependencies, not only ICU.
After replacing it, repeat command -v, readlink -f, ldd and --version. A wrapper may continue calling the old path unless its configuration or gem installation is updated.
Why a different ICU symlink is unsafe
ICU libraries use versioned sonames. Historical Debian build records show versioned ICU names alongside unversioned linker names, illustrating that names vary by platform and package version. They do not prove that one ICU ABI is compatible with another.
For example, creating libicui18n.so.42 as a symlink to libicui18n.so.XX may make the loader start, but it can produce symbol errors, corrupted output or crashes later. No compatibility matrix in the available evidence establishes that substitution as safe. Install the matching runtime or use a compatible executable instead.
Test the fix with a controlled capture
Use a simple URL first, then test the URL your application normally renders:
wkhtmltoimage --format png https://example.com test.png
file test.png
If the command starts but fails during rendering, the ICU startup problem is resolved and you have a separate page-loading, font, graphics or network issue. Capture the full stderr output and check the binary’s dependencies again.
Troubleshooting branches
The exact library is still “not found”
- Confirm that the installed file is exactly
libicui18n.so.42, not merely an unversioned linker file. - Verify that the package matches the host architecture; a 32-bit library cannot satisfy a 64-bit executable.
- Check that the loader cache includes the directory containing the library.
- Make sure the application is not invoking a second copy installed by a gem or container image.
The package manager cannot find ICU 42
Do not force a package from an unrelated release. Reassess whether the binary is obsolete for this host and choose a build whose dependencies are available from supported repositories. The historical CentOS 6.6 context should not be copied blindly to a current system.
Rank #4
A new missing library appears
Run ldd again and resolve dependencies one at a time from the host’s repositories. One repaired loader entry does not imply that the binary’s complete runtime environment is present.
The fix works interactively but not in a service
Services can use a different PATH, environment, container layer or user account. Log the absolute executable path from the service configuration and run the same ldd check in that environment. Avoid relying on shell startup files that the service does not read.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →The error returns after an upgrade
An OS or gem update may have replaced either the executable or ICU runtime. Record the binary path and package versions during deployment, then rerun the dependency check as part of the release validation.
Performance, reliability and operational notes
Installing a runtime package is usually the smallest change when the existing binary is otherwise supported. Replacing the binary can be cleaner when the host no longer carries the old ICU ABI, but it may change rendering behavior and requires retesting fonts, JavaScript and page layout.
- Pin the executable and runtime package versions in repeatable deployments where practical.
- Validate both architecture and distribution release in build pipelines.
- Keep the complete stderr output from failed captures; it distinguishes loader failures from rendering failures.
- Do not copy libraries from another server or release merely because the filenames look similar.
Or skip the browser setup
If your goal is simply to obtain a reliable website image rather than maintain a local wkhtmltoimage stack, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP or PDF. It accepts cookie-consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing result.
With an API key, the basic call is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for parameters and response details. Equivalent examples:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also supports full-page captures with lazy images, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, pre-capture clicks, hidden selectors, selector/delay/network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
Best Value
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to try it.
FAQ
Is this a wkhtmltoimage rendering error?
No. The message occurs during process startup, before the renderer can load a page. Rendering diagnostics become relevant only after all shared libraries resolve.
Can I solve it by installing any package named ICU?
Not necessarily. The package must provide the exact soname required by the executable and match your operating system and architecture.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallShould I migrate every old wkhtmltoimage installation?
Not automatically. If the existing binary is supported and its matching runtime is available, installing that runtime may be sufficient. Migration is the safer route when the host cannot provide the requested ABI or the binary came from an obsolete environment.
Frequently Asked Questions
Is this a wkhtmltoimage rendering error?
No. It happens during process startup, before a page is loaded.
Can I solve it by installing any package named ICU?
Only a package that provides the exact requested soname for your release and architecture can satisfy this binary.
Should I migrate every old wkhtmltoimage installation?
No. Migrate when the required runtime is unavailable or the binary is obsolete; otherwise a matching runtime package may be enough.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsThe Bottom Line
Find the exact binary, match its required ICU soname to your Linux release and architecture, and install the supported runtime or replace the binary. Never paper over libicui18n.so.42 with an unverified symlink.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

