pigz which stands for Parallel Implementation of GZip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data.
For Ubuntu 16.04 or early
apt update && apt install zlib1g-dev
git clone https://github.com/madler/pigz.git
cd pigz
make
mv pigz unpigz /usr/bin
bash
cd ..
rm -r pigz
For Ubuntu 18.04 or later
sudo apt install pigz