The output from the above script is
Checking for curl…
Detected curl…
Checking for gpg…
Detected gpg…
Running apt-get update… done.
Installing apt-transport-https… done.
Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list…curl: (7) Failed to connect to packages.gitlab.com port 443: Connection timed out
the difference here being the | sudo bash on the end compared to your command, it would have worked no problem. Anyway, you found a different workaround, but end result was the same
I’d tried that first but it didn’t work. The issue was the environment, I need a proxy to be able to download from the web, so that’s why the sudo -E worked.
I suspect if I’d tried curl xxxxxxx | sudo -E bash it would have worked also.
Yep, that would work, preserving the environment variables with sudo -E means that your proxy variable (export http_proxy) was preserved and carried across for use in the sudo session. The other alternative is set the proxy system-wide, then it wouldn’t matter as all users would by default have the proxy variable set. In that scenario, the -E would not be needed.