Installing dependencies error: sudo: no tty present and no askpass program specified

tl;dr: I can’t call sudo in deps/build.jl. Can’t use BinDeps. This issue (BinDeps.jl#199) is related. What are the directives on installing dependencies?

Long version: I’m trying to install the dependencies of my packages using the deps/build.jl file. However, I’m getting the error

sudo: no tty present and no askpass program specified

At first I was using a bash script, but then I changed to BinDeps and the error remains. From what I understand, I could use askpass variable setting an askpass program but that seems counterproductive. I would like to install my package in the simplest way possible: one Pkg.add after a clean OS install.

Is this possible?

PS. Pkg.add("GSL") fails with the same problem, and I suspect others do too.

Please see my comment on the linked issue.