Asked • 06/21/19

How to keep environment variables when using sudo?

When I use any command with sudo the environment variables are not there. For example after setting HTTP_PROXY the command `wget` works fine without `sudo`. However if I type `sudo wget` it says it can't bypass the proxy setting.

3 Answers By Expert Tutors

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.