Turn Proxy Off/On on Linux VM

Turn Proxy Off/On on Linux VM


1. Log in to the Linux VM



2. Write command sudo nano /etc/environment press enter and enter your password



3. To turn Proxy Off, comment out all the content that you find in there e.g #http_proxy="http://127.0.0.1:8080"



4. Press ctrl + x to exit, save with y and press enter


5. Do the same thing with sudo nano /etc/apt/apt.conf.d/proxy.conf comment out all the content,  press ctrl + x to exit, save with y and press enter.

6. Restart the Linux VM

7. Write command: sudo apt-get update to check that Internet is available 



8. Proxy Off, done!

9. To turn Proxy back On, delete the "#".


Info

Be aware! Compared to Windows, Linux often relies on multiple base packages or libraries for network connectivity, such as glibc, libcurl, and openssl, among others. Each package or application can have its own mechanism for handling network connections, which sometimes bypasses global proxy settings.

When you configure a proxy in environment variables (e.g., http_proxy, https_proxy), many applications respect these settings. However, there are exceptions:

  1. Custom Network Implementations: Some applications use their own network stacks and do not honor environment variables by default.
  2. Proxy-Aware vs. Proxy-Unaware: Applications may not support proxies unless explicitly configured in their own settings.
  3. Libraries and Tools: Some lower-level libraries or tools (e.g., wget, curl, apt) might need additional configuration to use the proxy.
This decentralized approach contrasts with Windows, which centralizes network settings (like proxy configurations) in a single location that's often respected system-wide.