I have a raspberry pi with raspbian. I have to use a http proxy now, but where can I configure the proxy?
It seems the apt-get
ignores the http_proxy
, which I defined like this:
export http_proxy="http://username:password@host:port/"
I managed to solve it in the following way. Go to the following folder:
cd /etc/apt/apt.conf.d
Create a file named 10proxy
:
sudo nano 10proxy
Without authentication add the following line:
Acquire::http::Proxy "http://yourproxyaddress:proxyport/";
With authentication:
Acquire::http::Proxy "http://username:password@yourproxyaddress:proxyport/";
The /
at the very end was important. Without it it did not work.
If you run apt-get with sudo you have to modify /etc/sudoers
and append
Defaults env_keep = "http_proxy https_proxy ftp_proxy"
you can edit it by calling visudo
.
You could also use su
, set the proxy and then run apt-get
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With