Liam Arbel
Liam Arbel

Reputation: 557

Uninstalling vagrant-proxyconf doesn't remove proxy settings

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?

Upvotes: 1

Views: 457

Answers (1)

Zeitounator
Zeitounator

Reputation: 44635

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...)

Upvotes: 1

Related Questions