Step 1 - Installa the following package
sudo apt install imagemagick
Step 2 - Use the following command:
convert *.jpeg my_pdf.pdf
The command above might yield an “operation not allowed” error. Fortunately, we
can easily fix it by executing:
sudo sed -i 's/^.*policy.*coder.*none.*PDF.\*//' /etc/ImageMagick-6/policy.xml
or better:
sudo gedit
/etc/ImageMagick-6/policy.xml
add or change the row at end of the file (just before </policymap>) with the following:
<policy domain="coder" rights="read | write" pattern="PDF" />