How to install wkhtmltopdf (Amazon Linux2)

I made a note because I stumbled on various things when I installed wkhtmltopdf in the Amazon Linux 2 environment on the container. Check the basic procedure below. https://laox.com/ja/9mcv

Installation procedure

  1. Download wkhtmltopdf Download the required version of the package from the official repository.
cd /tmp
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos6.x86_64.rpm
  1. Installation of required fonts Without it, you will get angry when installing wkhtmltopdf.
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 
  1. Installation of wkhtmltopdf Here is where it didn't work like the referring page. The installation command is as follows.
rpm -Uvh wkhtmltox-0.12.6-1.centos6.x86_64.rpm

When I run it ...

rpm -Uvh wkhtmltox-0.12.6-1.centos6.x86_64.rpm
error: Failed dependencies:
        openssl is needed by wkhtmltox-1:0.12.6-1.centos6.x86_64

Apparently, the downloaded / saved file name is different from the required file name.

pwd
/tmp
ls -ltr
total 13252
-rw-r--r-- 1 root   root   13564280 Jun 11  2020 wkhtmltox-0.12.6-1.centos6.x86_64.rpm

By the way, the rpm options are as follows.

-U: rpm -U <rpm_file> can perform either upgrade or installation functions as needed for the package. -vh: With the -v and -h options (combined with -U), rpm displays the verbose output and uses the hash mark to display the progress meter.

https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/6/html/deployment_guide/sec-installing_and_upgrading

Why can't I use the downloaded file name as it is? By the way, when I tried to download openssl with the desired file name, I got a 404 error. I thought about renaming the file, but I think it's different. Examine the package dependencies.

rpm -qRp wkhtmltox-0.12.6-1.centos6.x86_64.rpmca-certificates
fontconfig
freetype
glibc
libX11
libXext
libXrender
libjpeg
libpng
libstdc++
openssl
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
xorg-x11-fonts-75dpi
xorg-x11-fonts-Type1
zlib

Are all of these dependencies installed? I decided to try it with the yum command.

yum install -y wkhtmltox-0.12.6-1.centos6.x86_64.rpm
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/3): make-3.82-24.amzn2.x86_64.rpm                       | 420 kB  00:00:00     
(2/3): openssl-1.0.2k-19.amzn2.0.4.x86_64.rpm              | 495 kB  00:00:00     
(3/3): openssl-libs-1.0.2k-19.amzn2.0.4.x86_64.rpm         | 1.2 MB  00:00:00 

It seems that they are doing it from the download of the package that seems to be missing. as a result,

wkhtmltopdf -V
wkhtmltopdf 0.12.6 (with patched qt)

Installed! Yum seems to work because it installs dependent packages as well.

■ Bonus

Garbled characters occur when I try to use it!

image.png

Since the work is root and the actual use is apache, is it a permission problem? You can read it if you think.

ls -ltr /usr/share/fonts/IPAexfont00301/          
total 13524
-rw-r--r-- 1 root root 7776964 Dec 21 16:17 ipaexm.ttf
-rw-r--r-- 1 root root 6041284 Dec 21 16:17 ipaexg.ttf
-rw-r--r-- 1 root root    1592 Dec 21 16:17 Readme_IPAexfont00301.txt
-rw-r--r-- 1 root root   20564 Dec 21 16:17 IPA_Font_License_Agreement_v1.0.txt

Recommended Posts

How to install wkhtmltopdf (Amazon Linux2)
How to install Anisble on Amazon Linux 2
How to install VMware-Tools on Linux
How to install MBDyn (Linux Ubuntu)
[AWS EC2] How to install Maven on Amazon Linux 2
How to install aws-session-manager-plugin on Manajro Linux
How to update php on Amazon linux 2
How to install packages on Alpine Linux
How to install Windows Subsystem For Linux
How to install php7.4 on Linux (Ubuntu)
How to install Python
How to install pip
How to install archlinux
How to install python
How to install BayesOpt
How to install Nbextensions
How to install Prover9
How to install Camunda Modeler on Manjaro Linux
[2020.8 latest] How to install Python
How to install Python [Windows]
Tabpy 1.0 (2020-01 version) How to install
How to install mkl numpy
Install tomcat 5.5 on Amazon Linux.
How to install Pelican blog
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
How to install git on Linux such as EC2
How to build a Python environment on amazon linux 2
[AWS] How to expand disk space on Amazon linux
How to install python using anaconda
Install Python Pillow on Amazon Linux
Install oracle java8 on amazon linux2
How to install and use Tesseract-OCR
How to install python-pip with ubuntu20.04LTS
How to install pycrypto on Windows
Install pyenv on EC2 (Amazon Linux)
How to install OpenCV on Mac
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install and configure blackbird
How to install CUDA and nvidia-driver
How to install and use Graphviz
Introducing Amplify to Amazon Linux 2 AMI
[Note] Install Imagick on Amazon Linux2
How to install mysql-connector with pip3
How to check Linux OS version
How to install Maven on CentOS
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
How to install Go on Ubuntu
How to install music 21 on windows
How to install Anaconda with pyenv
I'll install Ruby on EC2 (Amazon Linux2) 2020
How to build my own Linux server
[Linux] How to subdivide files and folders
How to install drobertadams / toggl-cli on Mac
How to install and use pandas_datareader [Python]
python3 How to install an external module
[Kivy] How to install Kivy on Windows [Python]
I want to know how LINUX works!
How to install CatBoost [as of January 2020]
How to install DLIB with 2020 / CUDA enabled