How to use apt-get behind proxy server (Ubuntu/Debian)
|
|
If you are a Debian-based GNU/Linux user, then you’re probably familiar with synaptic and apt-get to install application from software repositories. This post focussed on how to use apt-get/synaptic behind proxy server/firewall which under normal circumstances, you’re unable to use apt-get.
If you’re using Synaptic
Open up your Synaptic package manager (usually as root), go to Settings-> Preference -> Network. Enter your proxy server details like : username:password@proxyserver.net, and put the proxy server port (usually 8080).
If you’re using command-line apt-get
Edit your /etc/bash.bashrc file as root.
Put these line at the end of your /etc/bash.bashrc file :
export http_proxy=http://username:password@proxyserver.net:port/ export ftp_proxy=http://username:password@proxyserver.netport/
You can omit the username:password, if your proxy server has no password. That’s all for today! Happy apt-get-ing!
Keep updated with this website! : Subscribe to your email
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.














February 11th, 2006 at 7:07 am
How to use apt-get behind proxy server (Ubuntu/Deb… Feb 11, 2006 1:03 AM - Mypapit’s blog @ Computers If you are one of Debian-based GNU/Linux distro users, then you must have been familiar with synaptic and apt-get to install application from software
February 13th, 2006 at 2:37 am
I think it is advisable to always declare shell environmental variables in all caps.
export HTTP_PROXY=….
export FTP_PROXY=…
Cheers
–arky
February 15th, 2006 at 2:57 am
thanks for the correction Arky :)
February 17th, 2006 at 10:20 pm
[...] [...]
March 1st, 2006 at 2:15 pm
Hello all,
The problem with the solutions above is that a password is stored in a text file or in the Synaptic configuration. This is not acceptable to the IT staff where I work and really is the only reason I do not use Debian or Ubuntu at work.
Is there a more secure solution, perhaps a way to get a secure dialog box which asks for proxy username and password each time Synaptic is used? Similar to the web browser?
Thanks,
Bill Chivers
April 25th, 2006 at 3:20 am
Yeah, Bill if you want to use apt without storing a password you can do this:-
Add the following to /etc/bash.bashrc
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.”
}
Then whenever you want to set the proxy variable you just type “proxy” at the command line. When prompted for your proxyserver user name you type it in (you may need to type domain\\user if it’s a domain account) and then when prompted type your password (which isn’t echoed to the screen).
This will then set the environment variables, and they’ll be lost when you exit your session.
Cheers,
Al.
June 3rd, 2006 at 5:19 pm
[...] Hola, esto no lo he probado aun, pero lo pongo por si acaso y espero comentarios: How to use apt-get behind proxy server (Ubuntu/Debian)———- If you?re using command-line apt-get Edit your /etc/bash.bashrc file as root. Put these line at the end of your /etc/bash.bashrc file : export http_proxy=http://username:password@proxyserver.net:port/ export ftp_proxy=http://username:password@proxyserver.netport/ You can omit the username:password, if your proxy server has no password. That?s all for today! Happy apt-get-ing! —————- Tomado de http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html ESTE SI http://www.debian-administration.org/articles/177 ———– TAMPOCO!!!!!!!!!!! lo ?nico que me ha medio servido es lo de export hhtp_proxy=………… [...]
June 21st, 2006 at 6:26 pm
@proxyaddress:port/ echo -e \nProxy environment variable set. } Don?t forget to change: proxyaddress:port. With this everything should work. Want to know more? There are two references I read: 1,2.
September 10th, 2006 at 3:51 am
[...] Perhaps this is what you are looking for : http://blog.mypapit.net/2006/02/how-…ntudebian.html __________________ "To express yourself in freedom, you must die to everything of yesterday. From the ‘old’, you derive security; from the ‘new’, you gain the flow." -Bruce Lee [...]
September 12th, 2006 at 3:26 am
[...] Re: aptget not updating packages the method of getting updates behind the proxies is given in this urlhttp://blog.mypapit.net/2006/02/how-…ntudebian.html [...]
September 12th, 2006 at 9:37 am
I have a password that ends with the character @ , how do get around the fact that there are 2 @@ in one line and prevent the failure of auth because of this.
October 20th, 2006 at 4:09 am
[...] 22-02-2006 18:33 Prova a vedere qui: http://www.opensubscriber.com/messa…org/246055.html e soprattutto: http://blog.mypapit.net/2006/02/how…untudebian.html [...]
October 24th, 2006 at 9:01 pm
[...] Re: apt-get behind proxy server You may have found this by now, but since I came across your question while searching for the answer, this worked for me: http://blog.mypapit.net/2006/02/how-…ntudebian.html Note that I chose to change the .bashrc in my homedir rather than in etc, which would be a systemwide change… __________________ running Ubuntu for AMD64 on HP Compaq nx6125 PY416EA (Turion64 ML-34, Radeon Xpress 200M) [...]
November 22nd, 2006 at 11:47 am
What if I want to use proxy for some website and don’t use proxy for some other websites? How to configure that?
November 27th, 2006 at 1:33 am
after editing .bashrc file.I’m still getting the proxy authentication error message.plz get me out of this
December 20th, 2006 at 11:05 pm
You do not need to search for working free web proxies. All is here.
Find free web proxy for desired country!
All proxies are regulary checked if they still alive.
http://getproxy.emigrantas.com
enjoy it!
January 8th, 2007 at 11:24 pm
Hi,
I had the same problem and the export worked for me, but with quotes:
export http_proxy=”http://username:password@proxyserver.net:port”
export ftp_proxy=”http://username:password@proxyserver.net:port”
January 17th, 2007 at 11:32 am
[...] Source: link [...]
January 19th, 2007 at 4:51 pm
[...] Original post by Kremmen [...]
January 19th, 2007 at 5:06 pm
[...] Original post by Kremmen [...]
January 31st, 2007 at 8:31 pm
You can’t use the variable in uppercase (HTTP_PROXY) you have to use lowercase.
The CLI tools do not recognize the uppercase environment var.
February 19th, 2007 at 4:46 am
[...] http://blog.mypapit.net/…sia-tak-bogel-tapi-lucah.htmlhttp://blog.mypapit.net/…roxy-server-ubuntudebian.htmlhttp://blog.mypapit.net/…-cds-becareful-with-them.htmlhttp://blog.mypapit.net/…-advantage-tattoo-cracks.htmlhttp://blog.mypapit.net/…eo-files-to-avi-in-linux.htmlhttp://blog.mypapit.net/…now-available-on-windows.html [...]
February 24th, 2007 at 3:57 am
The lower-case export lines with quotes worked for me:
export http_proxy=”http://username:password@proxyserver.net:port”
export ftp_proxy=”http://username:password@proxyserver.net:port”
But I appended them to the file /etc/profile instead of /etc/bash.bashrc so that it would effect synaptic from the menus (and lots of other system programs).
February 25th, 2007 at 12:08 am
[...] If you are a Debian-based GNU/Linux user, then you ’re probably familiar with synaptic and apt-get to install application from software repositories. This post focussed on how to use apt-get/synaptic behind proxy server/firewall which under normal circumstances, you’re unable to use apt-get.Full Story [...]
February 28th, 2007 at 10:29 pm
[...] prova la 8080.e prova a leggere questo. attento a quando parla delle variabili d'ambiente, che vanno in maiuscolo (HTTP_PROXY e FTP_PROXY) [...]
March 29th, 2007 at 10:53 am
[...] ͺ:apt-get proxy Ѻ - 13/12/2006 01:53 2 ԸդѺ ͧٹФѺ1. ҹ Synaptic¡ Synaptic 价 Settings-> Preference -> Network ǡ proxy2. ҹ command-line apt-getҹ root /etc/bash.bashrc ͤ仹export http_proxy=http://usernameassword@proxyserver.netort/export ftp_proxy=http://usernameassword@proxyserver.netport/ʼҹ proxy 繢ͧسѺҧԧѺhttp://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html [...]
April 26th, 2007 at 12:21 pm
[...] There are a few posts on the web about how to do this some, saying you just need to set the environment variable http_proxy, others that you must specify the proxy settings in the file /etc/apt/apt.conf.d/70debconf . For my Kubuntu install I found a mixture of the two was required, more of which anon. [...]
April 28th, 2007 at 12:46 am
[...] So Sorry, En realidad no fue cut and paste, lo leí en… http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html y de ahí preparé la respuesta, Saludos, [...]
May 1st, 2007 at 6:55 pm
[...] Heute, 11:55 http://blog.mypapit.net/2006/02/how-…ntudebian.html da steht drin wie du den proxy einrichten kannst, dann apt-get update und dann viel spass! GEGEN TCPA [...]
June 25th, 2007 at 9:28 pm
[...] A w opcjach apt masz ustawione by korzysta z proxy??? info na temat masz np tu http://blog.mypapit.net/2…untudebian.html [...]
July 20th, 2007 at 7:06 pm
[...] Thank you all for replying .I used this solution and it worked :QuoteEdit your /etc/bash.bashrc file as root.Put these line at the end of your /etc/bash.bashrc file :export http_proxy=http://username:password@proxyserver.net:port/export ftp_proxy=http://username:password@proxyserver.netport/I found it here:http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.htmlMany thanks [...]
July 26th, 2007 at 8:24 pm
i wonder… i read ALL your comments… but it did not work… they are all great… but they will not work if u have another set of IP Addresses on your laptop… other then the ones used in the network you are in…
sometimes… i wonder hoe stupid i can be :D
THANKS FOR ALL THE HELP… great blog
August 30th, 2007 at 4:54 am
http://username:password@proxyserver.net:port” But I appended them to the file /etc/profile instead of /etc/bash.bashrc so that it would effect synaptic from the menus (and lots of other system programs). Source :http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html
October 4th, 2007 at 3:34 am
[...] http://blog.mypapit.net/2006….an.html???? [...]
October 4th, 2007 at 6:50 am
[...] http://blog.mypapit.net/2006….an.html???? [...]
October 7th, 2007 at 7:43 am
[...] Source : http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html [...]
October 8th, 2007 at 9:31 pm
[...] Nem?e to sthnout protoe se p?ipojuje p?es Proxy kter je bu? patn? nastaven nebo ji m patn? nastavenou.Zkus mrknout na: http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html [...]
November 27th, 2007 at 10:13 pm
On Debian this is not working at all.
No way to pass username and password correctly to apt.
I’ve done everything, and i got ubuntu woking well many months ago.
But debian… no way…
December 19th, 2007 at 5:19 am
sir
i dont know how to use proxy server, in internet explore i can set for proxy i.paddress and port but not working.
another problem is that
i can use same time , i.e mozila without proxy server, but with internet explore with proxy server
plz reply me, this is , my first time question
thanks
sharma
February 26th, 2008 at 1:23 pm
Set the http_proxy environment variable, but most importantly, open Synaptics Package Manager, go to Settings->Preferences. Then click on the Network Tab. Enter your proxy information there and you’ll be rolling immediately.
March 6th, 2008 at 7:28 am
Under gnome/ubuntu v7.04, I don’t have synaptics package manager or a settings/preferences/gnome path.
Instead, appended the 2 exports (lowercase) to /etc/bash.bashrc and put my proxy info into the dialog box on System/Preferences/Network Proxy.
April 15th, 2008 at 5:28 pm
[...] Source : http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html [...]
June 17th, 2008 at 12:24 pm
[...] 原文出处: http://blog.mypapit.net/2006/02/how-to-use-apt-get-behind-proxy-server-ubuntudebian.html [...]
June 17th, 2008 at 6:12 pm
[...] assume your using a non-transparent proxy which you haven’t configured Ubuntu to use. See: How to use apt-get behind proxy server (Ubuntu/Debian) : mypapit gnu/linux blog How to apt-get behind a proxy? - Ubuntu Forums apt-get thru proxy - Ubuntu Forums Hope that helps. [...]
June 23rd, 2008 at 4:09 am
thanks………….
July 3rd, 2008 at 11:53 pm
Efectivemente, añadiendo a los bashrc las variables en minúsculas y el contenido entrecomillado, funciona perfectamente.
Gracias!!
July 25th, 2008 at 7:39 pm
This worked for me http://ubuntuforums.org/archive/index.php/t-177926.html
September 14th, 2008 at 4:36 am
спасибо для этого красивейшего вебсайта
September 22nd, 2008 at 3:27 pm
It’s work!
Thanks