Ubuntu – internet access problem in Terminal

When we use different internet connection in one laptop, and if one of those connections is proxy server network connection, then we may have a problem with accessing internet in Ubuntu Software Center and in Terminal. I don’t know it is a bug or just settings reset, but problem exists. I am describing a problem:

In direct connection we haven’t any problem with internet access. But when we switch to proxy connection, at first everything is ok, internet works in Gnome.(and all applications can take access from GNOME). But Terminal and Software Center gives connection error. I investigated this problem in internet. And at last i have found solution. We can do this simple action in Terminal.

cd etc/apt
sudo gedit apt.conf

Then we see this document empty. So we write in it:

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

We save it and close. That’s all, internet access has been restored in Terminal and in Ubuntu Software Center.

First posted in e-haci.net

3 thoughts on “Ubuntu – internet access problem in Terminal

  1. Mohit Garg

    i think the bug you identified is correct but the solution is not correct as it is showing the error-> E: Syntax error /etc/apt/apt.conf:3: Extra junk at end of file

    please suggest the solution


  2. Mohit Garg

    i suggest not to copy the text as such as it taking some unwanted data from web page, it will work only if you type the given lines in the editor by yourself.


    it worked at last 🙂

  3. Elvin Haci

    Thanks for suggestion. This article needs to be corrected, because i posted it 4 monthes ago when i was not using Syntax Highlighter plugin. In latest articles i have already installed that plugin, so now codes are shown correctly and copy-pastes will work without any problem. 🙂