1.put proxy in networks tab

2.internet works from browsers, terminal or ubuntu updater can't connect to internet!

3.updated .bashrc , .profile in /home and /etc with below:

export $http_proxy=http://proxy_url:proxy_port/

export $ftp_proxy=ftp://proxy_url:proxy_port/

export $https_proxy=https://proxy_url:proxy_port/

4.created and updated apt.conf file in /etc/apt/ with below:

Acquire::http::Proxy “http://proxy_url:proxy_port/”;

Acquire::ftp::Proxy “http://proxy_url:proxy_port/”;

apt upgrade command worked after step 4 but still can't connect ,install ping any server or program or websites!

Can anyone help ? Strange to see there's no question thread running regarding this!

2 Answers 2


Try this:

sudoedit /etc/environment

Paste your network proxy and port from the second line like this:


This works for the terminal and software center. If you ever want to change the network configuration for the terminal and software center, just edit the file again. The GUI app in settings works for all other software like browsers. Hope you find this helpful

  • Thanks a lot.adding these variables here solves it all but along with it I had to edit apt config too to get the apt running behind proxy. Sep 19, 2018 at 6:32

I solve this by doing these steps, How to Set the Proxy for APT on Ubuntu 18.04:

  1. sudoedit /etc/environment
  2. http_proxy="http://proxy.server:port"
  3. sudo touch /etc/apt/apt.conf.d/proxy.conf
  4. sudo nano /etc/apt/apt.conf.d/proxy.conf
  5. Acquire::http::Proxy "http://proxy.server:port/";
  • This worked for me. Thanks a lot. Jan 25 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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