Search for:
🐧 Create a PDF from Multiple Images in Linux

πŸ”§ Step 1: Install img2pdf

Open the terminal and run:

  • sudo apt install img2pdf

πŸ“‚ Step 2: Go to Your Image Folder

Navigate to the folder containing your `.jpg` images:

  • cd /path/to/image-folder

πŸ“„ Create PDF β€” Random/Directory Order

To convert all JPG images into a PDF:

  • img2pdf *.jpg -o filename.pdf
  • img2pdf *.jpg -o images.pdf

πŸ”’ Create PDF β€” Name/Natural Order

If you want the images processed according to their filename/natural numeric order:

  • img2pdf $(ls -1v *.jpg) -o output.pdf

( For example: text
1.jpg
2.jpg
3.jpg
10.jpg
11.jpg

will be processed in the expected numeric order.

  • img2pdf *.jpg -o output.pdf

πŸš€ Quick Summary

Purpose Command

Install toolΒ  sudo apt install img2pdf
Convert JPGsΒ  img2pdf *.jpg -o output.pdf
Natural filename order img2pdf $(ls -1v *.jpg) -o output.pdf

Linux Tip:- No GUI required β€” create your PDF directly from the terminal! πŸ§πŸ’»

Install Nvm Ubuntu

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

export NVM_DIR=”$HOME/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && \. “$NVM_DIR/nvm.sh” # This loads nvm
[ -s “$NVM_DIR/bash_completion” ] && \. “$NVM_DIR/bash_completion” # This loads nvm bash_completion

source ~/.bashrc

MongoDB For Ubuntu 24.04

sudo apt-get install gnupg curl

curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
–dearmor

echo “deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list

sudo apt-get update

echo “mongodb-org hold” | sudo dpkg –set-selections
echo “mongodb-org-database hold” | sudo dpkg –set-selections
echo “mongodb-org-server hold” | sudo dpkg –set-selections
echo “mongodb-org-shell hold” | sudo dpkg –set-selections
echo “mongodb-org-mongos hold” | sudo dpkg –set-selections
echo “mongodb-org-tools hold” | sudo dpkg –set-selections

sudo apt-get install -y mongodb-org

sudo systemctl start mongod
sudo systemctl daemon-reload
sudo systemctl enable mongod
sudo systemctl status mongod

MongoDB For Ubuntu 20.04

sudo apt-get update

sudo apt-get -y upgrade

sudo apt-get -y install -f

sudo apt-get -y autoremove

wget -qO – https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add –
sudo apt-get install gnupg
wget -qO – https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add –
echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

echo “mongodb-org hold” | sudo dpkg –set-selections
echo “mongodb-org-database hold” | sudo dpkg –set-selections
echo “mongodb-org-server hold” | sudo dpkg –set-selections
echo “mongodb-org-shell hold” | sudo dpkg –set-selections
echo “mongodb-org-mongos hold” | sudo dpkg –set-selections
echo “mongodb-org-tools hold” | sudo dpkg –set-selections

sudo systemctl start mongod
sudo systemctl daemon-reload
sudo systemctl enable mongod