This is using docker, so is a fresh unmodified linux distribution.
Using julia1.0 or 0.7,
using Pkg
Pkg.add(“GZip”)
Pkg.build(“GZip”)
using GZip
┌ Info: Precompiling GZip [92fee26a-97fe-5a0c-ad85-20a5f3185b63]
└ @ Base loading.jl:1186
ERROR: LoadError: LoadError: error compiling top-level scope: could not load library “libz”
libz.so: cannot open shared object file: No such file or directory
Installing the ubuntu package zlib1g-dev worked.
Googling the problem, it looks like libz has caused a lot of problems, usually when packages that require python are needed. Unfortunately, these (jupyter, pyplot) are some of the most popular and basic packages.
EDIT: previously I thought this was due to an interaction with IJulia; in fact the problem occurs when GZip is the first package to be installed.