$ PROXY_HOST=proxy.example.com $ PROXY_PORT=8080
$ cat <<EOD | sudo tee /etc/apt/apt.conf.d/00proxy Acquire::ftp::Proxy "http://$PROXY_HOST:$PROXY_PORT"; Acquire::http::Proxy "http://$PROXY_HOST:$PROXY_PORT"; Acquire::https::Proxy "http://$PROXY_HOST:$PROXY_PORT"; EOD
sudo snap set system proxy.ftp="http://$PROXY_HOST:$PROXY_PORT" sudo snap set system proxy.http="http://$PROXY_HOST:$PROXY_PORT" sudo snap set system proxy.https="http://$PROXY_HOST:$PROXY_PORT"
export ftp_proxy="http://$PROXY_HOST:$PROXY_PORT" export http_proxy="http://$PROXY_HOST:$PROXY_PORT" export https_proxy="http://$PROXY_HOST:$PROXY_PORT"