Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: HOWTO: Update from behind a proxy server

  1. #21
    Join Date
    Nov 2009

    Re: HOWTO: Update from behind a proxy server

    I have exactly the same issue as Captain-Morgans.

    I have set up the Proxy Manager correctly as is evidenced by Firefox working correctly, although I did have to confirm the user name and password on four occasions as the proxy server checked and rechecked the first time I used Firefox.

    It seems that there is a fifth user name and password check for downloads and updates.

    Does anyone know how to either reset this or dive in and set it up from the inside, please?

    Newbie tutorial with idiot proof instructions gratefully received.

  2. #22
    Join Date
    Jan 2010

    Re: HOWTO: Update from behind a proxy server

    I have had the exact same problem as what has been described here, i.e.

    • I'm using KUbuntu 9.10
    • System is behind a organisation-wirde proxy server
    • Could connect to the internet with my proxy settings using Konquerer
    • But could not connect from KPackageKit or apt

    After spending two days on this, here is what finally worked for me:

    • Set http_proxy, ftp_proxy and https_proxy variables in bash.bashrc
    • Set proxy settings in /etc/apt/apt.conf
    • Set proxy settings in Network Connections -> Proxy in System Settings

    In all cases, I had to set it to:


    I do not like the setting of the password in a clear text file at all, but this was the only way I could get it to work.

    After logging out and then logging back in, this worked for me. I do not claim any deeper knowledge of the subject or that this will work for others as well. Just thought I post this here in case it is of use to anyone else.

  3. #23
    Join Date
    Apr 2007
    Westlake Village
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Update from behind a proxy server

    So can you give me an example of your apt.conf? and .bashrc?

    I only have some example apt.conf (/usr/share/doc/apt/examples/apt.conf)
    that I'm trying to see if I can add my proxy info to, but not sure of the format. No examples in this file.

    Thanks in advance!
    We'll beat any price guaranteed! Free first hour local installation.
    Custom Affordable High Definition HTPC
    Byte Knight Solutions, Thousand Oaks, CA

  4. #24
    Join Date
    May 2010
    viet nam

    Smile Re: HOWTO: Update from behind a proxy server

    I have same proble and here is my solution:

    1. edit /etc/bash.bashrc add to the end of file :

    export http_proxy=
    export ftp_proxy=
    - OR proxy no username and password case - :
    export http_proxy=
    export ftp_proxy=

    2. edit, or create new file /etc/apt/apt.conf :

    APT::Authentication::TrustCDROM "true";
    Acquire::httproxy ""

    Last edited by zerozone; May 18th, 2010 at 03:31 AM.

  5. #25
    Join Date
    Oct 2008

    Re: HOWTO: Update from behind a proxy server

    Ok I want to wrap it up and confirm ZeroZone to save people's time. The only thing I need to set is appending the following to /etc/bash.bashrc:

    export http_proxy=
    export ftp_proxy=

    I don't even have to do anything to apt.conf. I only install packages from command line in stead of Synaptic. So if you need Synaptic, you might have to touch apt.conf.

    TIP: make sure your new /etc/bash.bashrc takes effect by logging out and then back in as root. You can double check by the command "set | grep proxy". Cheers.

  6. #26
    Join Date
    Apr 2009
    Kuala Lumpur, Malaysia
    Ubuntu 11.10 Oneiric Ocelot

    Re: HOWTO: Update from behind a proxy server

    I've found this nice piece of script that might be of use on

    need to add the code to your /etc/bash.bashrc file
    function proxy(){
    echo -n “username:”
    read -e username
    echo -n “password:”
    read -es password
    export http_proxy=”http://$username:$password@proxyserver:8080/”
    export ftp_proxy=”http://$username:$password@proxyserver:8080/”
    echo -e “\nProxy environment variable set.”
    You need to logout and in again. After which by typing "proxy" at the command prompt you will be asked for your username and password that will occupy the two environment variables http_proxy and ftp_proxy.

    (1) you don't have to keep your password in a liable text file
    (2) user information will be forgotten once your session is closed
    (3) might be helpful with usernames and passwords that contain wildcard characters.
    (4) password won't be echoed to the display console
    Last edited by juliobahar; August 29th, 2010 at 11:59 PM.

  7. #27
    Join Date
    Jan 2011

    Re: HOWTO: Update from behind a proxy server

    Easy way for beginners

    (all you have to do is set the Proxy in Synaptic Package Manager

    From the top left Ubuntu menu

    System>Administration>Synaptic Package Manager

    Once in go for the top menu again

    Settings>Preferences then the Network tab

    Setting the correct Proxy here will make the ubuntu built in 'Update Manager' work and does not seem to be affected by changing

    System>Preferences>Network Proxy

    Worked on Ubuntu 10.04

  8. #28
    Join Date
    Aug 2007

    Re: HOWTO: Update from behind a proxy server

    I've done the above successfully in the past. All of a sudden it appears to have stopped working with Ubuntu 10.10 - same boxes and all that, just not passing authentication details. Errors are 407 Proxy authenticaion required (or something like that)

  9. #29
    Join Date
    Jun 2006
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Update from behind a proxy server

    Proxys are a PITA.
    if you do it with apt/apt.conf you could do this:

    No authentication:
    Acquire::http::proxy "http://[proxy](:[port])/";

    with authentication:
    Acquire::http::proxy "http://[user]:[password]@[proxy](:[port])/";

    You can replace http with https and ftp.

    There is also a timeout and retries settings:
    Acquire::http::Retries "10";
    Acquire::http::timeout "10";

    Though if you go this direction, you might also need to do modifications for wget, curl and other parts as well.
    Ping if you'd like to hear more for these.

    Edit bodhi.zazen : Fixed smiles in code
    Last edited by bodhi.zazen; January 26th, 2011 at 07:28 PM. Reason: Fixed smiles in code

  10. #30
    Join Date
    Feb 2011

    Smile Re: HOWTO: Update from behind a proxy server

    For all those people who have special characters in their username or password and hence can't configure apt, please use the URL-encoding for special characters in your username/password. So, if my username is abc and password is qwe@rty, then add the following lines to /etc/apt/apt.conf:

    Acquire::http: proxy "http://abc:qwe%40rty@proxy: port/";
    Acquire::ftp: proxy "ftp://abc:qwe%40rty@proxy: port/";
    Acquire::https: proxy "https://abc:qwe%40rty@proxy: port/";

    P.S.: No spaces are needed after the colons( : ) in these lines.

    The URL-encoding for characters can be found at

    Last edited by utkarshspat; April 27th, 2011 at 10:18 AM.

Page 3 of 4 FirstFirst 1234 LastLast


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts