Windows 10 WSL Ubuntu 18.04 proxy configuration for apt.

Nov 15, 2018 · 2 min read
Image for post
Image for post

Using Windows Subsystem for Linux (WSL) can be a great tool for dev’s, op’s, and admin’s alike. The downside often these roles are after larger organization that gave Firewalls and tight proxy security.

I found myself in this exact situation. The corp. proxy uses a *.pac file script. Nothing in the Debian world does. Ugg. Here is how I got Debian apt to work behind a proxy.

Original Solution Source from the Linux Questions Forums.

wget http://some.domain.tld/some-proxy.pac

…or you can probably just open it with a browser.

Look for the proxy address that is used if all other options fail. Typically towards the bottom / in a function call of its own.

function FindProxyForURL(url, host) { return "PROXY; DIRECT"; }

Take note of the URL:PORT address.

Finally, put this in your /etc/apt/apt.conf file:

Acquire::http::Proxy "";

Log out and back in. At this point apt-get update -y and related apt commands should work as expected.

Image for post
Image for post

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store