apt - How to configure Software Center to work with HTTP proxy?

  • Neeraj

    I installed Ubuntu 12.04 LTS using the Windows installer (Wubi) yesterday. And then I tried to install Chrome, Flash player, etc., but nothing worked. Then I tried installing some random package using the Software Center (to see if it would work), and that didn't work either. Most of the times it shows updating cache but nothing happens thereafter. Sometimes I get a message saying that it failed to download repository (I don't know what this means) and telling me to check my Internet connection.

    I am using my institutional LAN network with a proxy requiring authentication with a username and password. Firefox is working fine...!

    I browsed the Internet for solutions and I tried many commands in the Terminal but nothing worked. Today I uninstalled and then freshly installed it again, and then the first thing I did is to ask this question here. So plz help me... give me a step by step procedure to conquer Ubuntu.

  • Answers
  • Andrew

    I had set proxy details in System > Network and applied system wide but was unable to use the Software Center (Firefox was fine). I read in another question here somewhere that a user had done sudo gedit /etc/apt/apt.conf and put in Acquire::http::proxy "http://user:pass@proxy:port" even though he didn't use a username and password for the proxy and it worked for him.

    I DO need to enter a username and password but my actual username and password entered in that string wouldn't work, BUT when I just put in the actual words "user:pass" the Software Center started working!

  • mrravi

    enter following command in terminal sudo gedit /etc/apt/apt.conf put the below line in file opened above i.e apt.conf

    Acquire::http::Proxy"http://user:password@proxy:port"; //sample //Acquire::http::Proxy"http://ravi:[email protected]:80";

    //user,password are internet user id and passowrd //same way do it for https,ftp

  • Sourav Sarkar

    I also had the same problem... my proxy was 10.x.xxx.xxx and port xxxx and no userid and pass was required..i just turned off Airplane mode > dash>network and now everything is working fine

  • Related Question

    Ubuntu 11.10 Software Center (proxy?)
  • James Eding

    I am unable to install software using the Software Center at work. A nearly identical install of 11.10 at home works fine. I suspect the proxy settings are the problem, as they are used at work, but not at home. The system at work does browse the web and respond appropriately to nslookup's.

  • Related Answers
  • jgomo3

    Create or edit /etc/apt/apt.conf defining your proxy configuration_

    Acquire::http::Proxy "http://username:password@proxy_name_or_ip:port/";
    Acquire::https::Proxy "https://username:password@proxy_name_or_ip:port/";
    Acquire::ftp::Proxy "ftp://username:password@proxy_name_or_ip:port/";

    You could ignore the username and password if you make no use of they, and you could ignore https or ftp in the same way.

    This is based on a comment in a ticket reporting this issue.

  • Steven Peter Beer

    Search for "network proxy" in Dash. Fill out your proxy details and set it system wide. Now, the software center can get the required packages via proxy server you set.