Uninstalling vagrant-proxyconf doesn't remove proxy settings

这一生的挚爱 提交于 2019-12-24 11:19:33

问题


I installed vagrant-proxyconf and added to Vagrantfile the following:

if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://192.168.33.10:3128/"
config.proxy.https = "http://192.168.33.10:3128/"
end

Later I uninstalled vagrant-proxyconf and removed the above lines from Vagrantfile.

Now every time I try to use apt-get or npm i , I get this error message:

Failed to connect to 192.168.33.10 port 3128: Connection refused

So the proxy settings are still somewhere within the vagrant config, yet not in the Vagrantfile. Where else can I look?


回答1:


You have removed both the plugin and its config for your vm after your vm had been configured (on vagrant up). Now when you start your existing vm again, the configuration done by the gone plugin is still in place.

Easiest solution: fresh install

The easiest way to get everything back is simply to vagrant destroy your existing machine and vagrant up a fresh new one.

Deconfigure with plugin help

If for whatever reason you wish to keep your existing machine, you can:

  1. vagrant halt if it is on
  2. rerun vagrant install vagrant-proxyconf without any config in place
  3. vagrant up so that the proxy is deconfigured everywhere needed,
  4. vagrant halt the machine again
  5. remove the plugin and go back to a normal life.

Manually undo what plugin has done

The latest solution is to check what the plugin is doing exactly in your particular case (OS, provider, etc...) by analysing its source code and remove every config done in your vm manually (environment variables, config for apt, etc...)



来源:https://stackoverflow.com/questions/56827707/uninstalling-vagrant-proxyconf-doesnt-remove-proxy-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!