Pages

Friday, September 23, 2011

Updating Packages behind prxy server in UBUNTU 11.10

Problem :  apt-get , Update Manager not able to download packages behind college/comapny proxy server.

Note : Sometimes there may be connection failure because of busy servers. So Please be patient during new Ubuntu release

Solution :
 
1) Open the Terminal and type the following command
     sudo gedit /etc/apt/apt.conf.d/02proxy

Note : 01proxy file is not present earlier.

2) Type the following line(in red) in the file:
     Acquire::http::Proxy “http://yourusername:yourpassword@yourproxy:yourport″;
    
Acquire::http::Proxy "http://foss:3189";
   


3) Save the file and your problem is solved.




28 comments:

  1. You are life saver. Thank you very much for this post.

    ReplyDelete
  2. I almost gave up on having a working ubuntu behind proxy. Man, ubuntu is becomin like windows, with every new version more and more things work worse or don't work at all, but oh, it looks so much nicer x(.

    Anyway, tanks a lot

    ReplyDelete
  3. SWEEEETTT!!!!!

    I also gave up

    ReplyDelete
  4. Thanks allot
    in home i removed the file but the apt-get no longer works
    so how can i remove the proxy from terminal ?
    Thanks

    ReplyDelete
  5. Just a correction, In the example add semicolon at end of the line.

    Acquire::http::Proxy “http://yourusername:yourpassword@yourproxy:yourport″;

    **It worked fine**
    Thanks :)

    ReplyDelete
  6. @Anonymous Oct 22

    I am out on vacation. Will check it after coming home

    @Anonymous Oct 24

    Thanks for the correction :)

    ReplyDelete
  7. Still not working... :(

    ReplyDelete
  8. Didn't work, when running apt I get an error message referring to the 02proxy file created by following this guide which says "junk at end of file"

    ReplyDelete
  9. @Anonymous(Nov 13)

    This is a syntax problem. Please Check that all the symbols are correctly placed.
    It is working fine on my system.

    ReplyDelete
  10. Naveen . . .. U r Awesome!! :))

    ReplyDelete
  11. Thanks very much....You saved my day!!!!

    ReplyDelete
  12. hey what happens if you ahve @ in your password. should i escape them? if so how?

    ReplyDelete
    Replies
    1. you can put '\' in front of special characters. DO NOT USE QUOTES.

      Ex:
      Acquire::http::Proxy "http://yourusername:yourpassword@yourproxy:yourport″;

      Acquire::http::Proxy "http://yourusername:pass\@word@yourproxy:yourport″;

      This should work. Try and tell me whether this thing works or not.

      Delete
  13. thanks!! i was just smashing my head against the table for the past two hours.

    ReplyDelete
  14. tried the above but still getting the error (407 proxy authentication required). my username has '\' (backslash character) how do i work around this?

    ReplyDelete
  15. This is a syntax problem. Please Check that all the symbols are correctly placed.
    It is working fine on my system.

    ReplyDelete
  16. You should be able to quote a backslash with another backslash:

    SILLYDOMAIN\\user:p\@ssword@1.1.1.1:8080

    E

    ReplyDelete
  17. hey man, works great! works too for 12.04!

    ReplyDelete
  18. i tried the very same thing but it replied " command not found"

    actually my friend had once done the proxy settings for my terminal nd now he is out and i need to change my proxy settings....can u suggest me as to how to go from the scratch of editing the proxy settings as i am new to ubuntu

    ReplyDelete
    Replies
    1. Do you have gedit installed in your system?

      You can follow these steps
      1. Go to /etc/apt/apt.conf.d/ folder.
      2. Create a file with name as 02proxy
      3. Enter the line given below by replacing your proxy settings.

      Acquire::http::Proxy “http://yourusername:yourpassword@yourproxy:yourport″;

      4. Save and exit
      5. END

      Delete
  19. you are a life saver, just installed ubuntu 12.04 beta on proxy and i was struggling updating system.... big ups!! :-)

    ReplyDelete
  20. Facing same problem in 12.04.. Any solution??

    ReplyDelete
  21. Thanks.. the same solution works for 12.04 too...

    ReplyDelete
  22. Hello I'm using Ubuntu server 12.04 behind a proxy, I was having trouble to do updates and that didn't work.
    However, I commented out that definition in file etc/apt/apt.conf (# Acquire::http::Proxy "http://yourproxy:yourport″;) and strangely that solved the issue.
    Now works fine. Go figure!

    ReplyDelete
  23. Hello !

    I've had the same problem. My ubuntu box is behind a proxy and needs a user and password. Seems to work, if I use in System Settings -> Network -> Proxy
    the following for HTTP, HTTPS, FTP and Socks Host :

    proxy_username:proxy_password@proxy_ip

    instead of

    proxy_ip

    only.

    Example :

    bob:TopSecret@192.168.33.2

    bob = Proxy username
    TopSecret = Proxy Password of bob
    192.168.33.2 = Proxy IP

    ReplyDelete
  24. Great Help
    I too almost gave up decided this is the last thing
    and wohooo it worked

    Thanks man

    ReplyDelete
  25. stiil not working error:-

    (gedit:3350): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.1W01EW': No such file or directory

    (gedit:3350): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

    (gedit:3350): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.L922EW': No such file or directory

    (gedit:3350): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

    ** (gedit:3350): CRITICAL **: _gedit_tab_save_as: assertion `(tab->priv->state == GEDIT_TAB_STATE_NORMAL) || (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)' failed

    (gedit:3350): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.GLDDFW': No such file or directory

    (gedit:3350): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
    manuj@manuj-VPCEH26EN:~$ sudo gedit /ect/apt/apt.conf.d/02proxy

    (gedit:3370): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.DY46EW': No such file or directory

    (gedit:3370): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

    (gedit:3370): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.L830EW': No such file or directory

    (gedit:3370): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

    ** (gedit:3370): CRITICAL **: _gedit_tab_save_as: assertion `(tab->priv->state == GEDIT_TAB_STATE_NORMAL) || (tab->priv->state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) || (tab->priv->state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)' failed
    sys:1: GtkWarning: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.QUT0EW': No such file or directory
    sys:1: GtkWarning: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
    sys:1: GtkWarning: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.QD4VEW': No such file or directory
    sys:1: GtkWarning: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.51MAFW': No such file or directory
    sys:1: GtkWarning: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.M6N0EW': No such file or directory

    please tell me what to do........

    ReplyDelete

Suggestions