Creating foo.pdf …
~/bin/wkhtmltox/bin/wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
Error: foo.pdf not found.
How do I fix this problem with out installing the xserver on my Ubuntu or Debian server?
You can find the missing libs using the ldd command:
$ ldd /path/to/wkhtmltopdf
Sample outputs:
linux-vdso.so.1 => (0x00007fffdd3c6000) libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f64cd4bd000) libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f64cd27a000) libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f64ccfcf000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f64ccdbd000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f64cca83000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f64cc868000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f64cc664000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f64cc45c000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f64cc23e000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f64cbebc000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f64cbbb3000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f64cb99c000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f64cb5d3000) /lib64/ld-linux-x86-64.so.2 (0x00005564cb080000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f64cb3aa000) libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f64cb184000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f64caf62000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f64cad5d000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f64cab57000)
Now you can search for missing libs using:
$ apt-cache search libXrender
In my case the following were missing
- libXrender: X Rendering Extension client library
- libfontconfig1: generic font configuration library – runtime
Fixing error while loading shared libraries on a Ubuntu/Debian Linux
Armed with this new info, I need to use the following apt-get command or apt command to install libxrender1 and libfontconfig1 to solve this issue:
$ sudo apt-get install libfontconfig1 libxrender1
OR
$ sudo apt install libfontconfig1 libxrender1
If you are using any other Linux distro you need to search as described above and install missing libs.
See also
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Another solution is to do this: