Installing pdftk on Ubuntu
Install a command line tool pdftk on Ubuntu.
sudo apt update
sudo apt install pdftk-java
Removing pages of .PDF document
Here is the example of a command to keep pages 6-12 and 24-end of the original file.
pdftk oldfile.pdf cat 6-12 24-end output newfile.pdf
The “end” in “24-end” means end page.
Before and After
Before:
After: