1

This question already has an answer here:

So I am running Ubuntu Studio on my laptop and what do I do to connect to a proxy? I search for proxy and in network settings their is no PROXY tab. What are key words in the tabs to look for?

marked as duplicate by muru, Thomas, Zanna, Eric Carvalho, K7AAY Jul 11 '18 at 17:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

I wrote a script in response to a question at Unix & Linux about setting proxies:

#! /bin/bash
HTTP_PROXY_HOST="proxy.example.com"
HTTP_PROXY_PORT=3128
HTTPS_PROXY_HOST="proxy.example.com"
HTTPS_PROXY_PORT=3128

gsettings set org.gnome.system.proxy mode manual
gsettings set org.gnome.system.proxy.http host "$HTTP_PROXY_HOST"
gsettings set org.gnome.system.proxy.http port "$HTTP_PROXY_PORT"
gsettings set org.gnome.system.proxy.https host "$HTTPS_PROXY_HOST"
gsettings set org.gnome.system.proxy.https port "$HTTPS_PROXY_PORT"

sudo sed -i.bak '/http[s]::proxy/Id' /etc/apt/apt.conf
sudo tee -a /etc/apt/apt.conf <<EOF
Acquire::http::proxy "http://$HTTP_PROXY_HOST:$HTTP_PROXY_PORT/";
Acquire::https::proxy "http://$HTTPS_PROXY_HOST:$HTTPS_PROXY_PORT/";
EOF

sudo sed -i.bak '/http[s]_proxy/Id' /etc/environment
sudo tee -a /etc/environment <<EOF
http_proxy="http://$HTTP_PROXY_HOST:$HTTP_PROXY_PORT/"
https_proxy="http://$HTTPS_PROXY_HOST:$HTTPS_PROXY_PORT/"
EOF

Save to a file (call it proxy.sh), edit it using your favourite editor to set the values of the *_PROXY_* variables and run:

chmod +x proxy.sh
./proxy.sh

It does, as far as I am aware, exactly what the GUI does (if based on a GNOME environment, which Ubuntu Studio is).

0

You can set your proxy via the terminal.

You should, for that, edit the following files:

/etc/bash.bashrc
/etc/environment
/etc/apt/apt.conf
/usr/local/etc/freshclam.conf 

These files must have the following contents:

    sudo -i
    nano  /etc/bash.bashrc
  ------------------------------------------------------------------ 
    export http_proxy=http://username:password@proxyserver.net:port/
    export https_proxy=http://username:password@proxyserver.net:port/
    export ftp_proxy=http://username:password@proxyserver.net:port/
  ------------------------------------------------------------------

Control + O, save file.

    sudo -i
    nano  /etc/environment
   ----------------------------------------------------------
    http_proxy=http://username:password@proxyserver.net:port/
    https_proxy=http://username:password@proxyserver.net:port/
    ftp_proxy=http://username:password@proxyserver.net:port/
   ----------------------------------------------------------

Control + O, save file.

    sudo -i
    nano /etc/apt/apt.conf
    --------------------------------------------------------------------
    Acquire::http::Proxy "http://username:password@proxyserver.net:port";
    Acquire::https::Proxy "http://username:password@proxyserver.net:port";
    Acquire::ftp::Proxy "http://username:password@proxyserver.net:port";
    ---------------------------------------------------------------------

Control + O, save file.

    sudo -i
    nano  /usr/local/etc/freshclam.conf 
    -------------------------------- 
    HTTPProxyServer proxyserver.net
    HTTPProxyPort port
    HTTPProxyUsername username
    HTTPProxyPassword password
    --------------------------------

Control + O, save file. Control + X, close nano

Not the answer you're looking for? Browse other questions tagged or ask your own question.