apt-get update error using automatic proxy configuration

7,309

apt-get does not use the global proxy settings. Try adding the proxy settings to /etc/apt/apt.conf:

Acquire::http::proxy "http://<your-proxy-url>";

Or just run the following commands in terminal:

sudo su
echo 'Acquire::http::proxy "http://<your-proxy-url>";' >> /etc/apt/apt.conf
Share:
7,309
mahi
Author by

mahi

Updated on September 18, 2022

Comments

  • mahi
    mahi over 1 year

    I am using Ubuntu 10.4.04 LTS with in VMware5. I used automatic proxy configuration and I'm able to use internet from firefox. When I wanted to update apt-get update, I am getting following errors. The following link gives some solution, but I don't have any port number as I'm using automatic proxy https://answers.launchpad.net/uck/+question/108860.

    Error:

    Ign http security.ubuntu.com lucid-security multiverse Packages              
    Ign http security.ubuntu.com lucid-security multiverse Sources               
    Ign http security.ubuntu.com lucid-security main Packages                                  
    Err http security.ubuntu.com lucid-security main Packages                    
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http security.ubuntu.com lucid-security/restricted Packages              
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http security.ubuntu.com lucid-security/main Sources                     
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http security.ubuntu.com lucid-security/restricted Sources               
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    Err http security.ubuntu.com lucid-security/universe Packages
      Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    W: Failed to fetch http security.ubuntu.com/ubuntu/dists/lucid-security/Release.gpg  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    
    W: Failed to fetch http security.ubuntu.com/ubuntu/dists/lucid-security/main/i18n/Translation-en_US.bz2  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    
    W: Failed to fetch http security.ubuntu.com/ubuntu/dists/lucid-security/restricted/i18n/Translation-en_US.bz2  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
    

    Thank you for your response!

  • mahi
    mahi almost 11 years
    Thank you so much for your quick response. I added this setting to apt.conf but I am getting "E: Syntax error /etc/apt/apt.conf:2: Extra junk after value" error. I spent some time on internet to find out but I couldn't, so I came back again. Thank you for the reply. Uma
  • Entropia
    Entropia almost 11 years
    Maybe you got my answer wrong. I updated it to make it more clear that the code example was meant to be run in terminal.
  • mahi
    mahi almost 11 years
    thank you! Now its connecting to proxy but I am getting same errors "W: Failed to fetch http security.ubuntu.com/ubuntu/dists/lucid-security/multiverse/s‌​ource/Sources.gz 404 Not Found Err http security.ubuntu.com lucid-security/multiverse Sources 404 Not Found" Actually I want to install "xinetd"
  • Entropia
    Entropia almost 11 years
    That's strange. Maybe you have to specify a port number, like http://<some-url>:<port-number>/? Although a wrong port should lead to different errors.
  • David Foerster
    David Foerster over 7 years
    I recommend editing this answer to expand it with specific details about how to do this. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on AskUbuntu.)