• HWIKI

    Build. Break. Explain.

    APT Behind Proxy

    When working behind a corporate firewall or a restricted network, you need to explicitly tell APT how to route its traffic. Instead of messing with global environment variables, the cleanest way is to create a dedicated configuration file.

    1. Create the config file:

    bash
    vim /etc/apt/apt.conf.d/proxy
    

    2. Add your proxy details:

    Acquire::http::Proxy "http://PROXY:PORT";
    Acquire::https::Proxy "http://PROXY:PORT";
    

    Replace PROXY:PORT with your actual gateway (e.g., 10.0.0.1:3128).

    Quick Tip: If your proxy requires authentication, use the format: http://user:password@proxy:port