This script is meant to simplify ghostscript syntax and also to have a convenient and practical solution for PDF compression.
The only dependencies you need to install ghostscript. To do this, just go to the repo of your Linux distro or to brew if it is mac os x and install the package of the same name. For the rest the script can be put in a path to be more convenient.
sudo pacman -S ghostscript
sudo apt install ghostscript
sudo yum install ghostscript
brew install ghostscript
Of course it is also possible to install it manually