tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

apt-get update should be triggered after adding proxy #65

Closed hexmode closed 10 years ago

hexmode commented 10 years ago

I did "Vagrant up" before my vpn was up. Since I wasn't on the VPN, the proxy wasn't needed or available, so I didn't have vagrant-proxyconf installed.

I started my vpn, added vagrant-proxyconf, and re-provisioned the machine. Provisioning wasn't able to finish since apt-get didn't work because apt apparently saves the non-proxied URLs as the sources for installation. Only after re-running "apt-get update" was the provisioning able to complete.

To solve this, I suggest triggering "apt-get update" after the proxy has been added, removed, or changed.

tmatilai commented 10 years ago

Hi Mark,

This sounds a bit strange, as the URLs should stay the same, and proxy settings are only applied at run time and shouldn't require apt-get update. What is the guest distro and version?

hexmode commented 10 years ago

I agree, it certainly wasn't how I thought apt-get worked.

Ubuntu's Precise.

hexmode commented 10 years ago

nevermind. It looks like I was able to track this down to the http_proxy envvar still being used at times. Weird.

tmatilai commented 10 years ago

Worth noting that if you just disable vagrant-proxyconf (by uninstalling it, setting config.proxy.enabled = false, or just not configuring it) will not remove/reset any previously configured settings on the guest. To clean up previous configuration you need to use config.proxy.http = false or set VAGRANT_HTTP_PROXY="" etc.