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″;
3) Save the file and your problem is solved.
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.
You are life saver. Thank you very much for this post.
ReplyDeleteI 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(.
ReplyDeleteAnyway, tanks a lot
SWEEEETTT!!!!!
ReplyDeleteI also gave up
Thanks allot
ReplyDeletein home i removed the file but the apt-get no longer works
so how can i remove the proxy from terminal ?
Thanks
Just a correction, In the example add semicolon at end of the line.
ReplyDeleteAcquire::http::Proxy “http://yourusername:yourpassword@yourproxy:yourport″;
**It worked fine**
Thanks :)
@Anonymous Oct 22
ReplyDeleteI am out on vacation. Will check it after coming home
@Anonymous Oct 24
Thanks for the correction :)
Still not working... :(
ReplyDeleteDidn'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@Anonymous(Nov 13)
ReplyDeleteThis is a syntax problem. Please Check that all the symbols are correctly placed.
It is working fine on my system.
@ Anonymous(Nov 13)
ReplyDeleteI too got the same error. It is the problem due to copy and past from this site in your editor. The double quotes is converted into to some other character. After pasting, please remove the double quotes and type it in your editor and save. I hope this will resolve your problem also
@Naveen.. Thanx a lot buddy. You saved my time
Naveen . . .. U r Awesome!! :))
ReplyDeleteThanks very much....You saved my day!!!!
ReplyDeletehey what happens if you ahve @ in your password. should i escape them? if so how?
ReplyDeleteyou can put '\' in front of special characters. DO NOT USE QUOTES.
DeleteEx:
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.
thanks!! i was just smashing my head against the table for the past two hours.
ReplyDeletetried the above but still getting the error (407 proxy authentication required). my username has '\' (backslash character) how do i work around this?
ReplyDeleteThis is a syntax problem. Please Check that all the symbols are correctly placed.
ReplyDeleteIt is working fine on my system.
You should be able to quote a backslash with another backslash:
ReplyDeleteSILLYDOMAIN\\user:p\@ssword@1.1.1.1:8080
E
hey man, works great! works too for 12.04!
ReplyDeleteGreat info.
ReplyDeletei tried the very same thing but it replied " command not found"
ReplyDeleteactually 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
Do you have gedit installed in your system?
DeleteYou 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
you are a life saver, just installed ubuntu 12.04 beta on proxy and i was struggling updating system.... big ups!! :-)
ReplyDeleteFacing same problem in 12.04.. Any solution??
ReplyDeleteThanks.. the same solution works for 12.04 too...
ReplyDeleteHello I'm using Ubuntu server 12.04 behind a proxy, I was having trouble to do updates and that didn't work.
ReplyDeleteHowever, 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!
Hello !
ReplyDeleteI'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
Great Help
ReplyDeleteI too almost gave up decided this is the last thing
and wohooo it worked
Thanks man
stiil not working error:-
ReplyDelete(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........
fuck ..
ReplyDeleteit has nothing to do with 12.04..
i am frustrated ..
Thanks man...works for Ubuntu 12.04 as well..!!
ReplyDeleteIf your login is like this:
ReplyDeleteDomain\login
replace the \ by %5C
Acquire::http::Proxy “http://Domain%5Clogin:yourpassword@yourproxy:yourport″;
Thanks a lot.
ReplyDeleteYour help ist greatly appreciated, saved me lots of time and led me out of a valley of desparation.
Works fine for 12.04
works in Ubuntu 12.04 x64
ReplyDeletestill not working, after making the changes i tried sudo apt-get install vlc and this is what i got:
ReplyDeleteReading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vlc
This worked, thanks. It really annoys me that Ubuntu keeps changing stuff for no good reason, in my 10.04 LTS servers all i have to do is edit /etc/apt/apt.conf but now I have to do it this way. They also made resolv.conf dynamic for no good reason and I can't directly edit it anymore...
ReplyDelete