Main menu
Skip to primary content
Quick Start
Downloads
Buy Codecs
Forum
FAQs
About
About us
Contact us
Technical, help and resource documents
Trademark rules
Raspberry Pi
FAQ Register Login
Search…
Connect Raspi to a Proxy
Post a reply
17 posts
by raspiworld » Thu Sep 27, 2012 7:52 pm
Hi, I have a problem with my internet connectivity.
I only have acces to the Internet over a proxy server. When I try to visit a website with the browser, it works,
because of the proxy settings of the browser.
But when I want to install new software, there is no connection to the Internet, when I tipe in "aptget
update" for example.
Is there any posibility or setting to get access to the internet over a proxy?
Thank you!
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm
by Wendo » Sat Sep 29, 2012 2:22 am
Add the following lines to the file /etc/environment
export http_proxy="http://username:password@host:port/"
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm
by phughes » Tue Oct 02, 2012 10:09 am
Hi,
Very new to this. I have tried to edit the file as you have said, no authentication required.
export http_proxy=http://proxy.county.ac.uk:8080
This doesn't seem to do anything. Did you get it working??
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 1/6
27/10/2016 Raspberry Pi • View topic Connect Raspi to a Proxy
Cheers,
Pete
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK
by VAXXi » Tue Oct 02, 2012 11:10 am
apt seems to ignore the HTTP_PROXY environment variable.
You can make it work by putting
Code: Select all
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
in a file placed in /etc/apt/conf.d (named similar to "10proxy" for example). It should also work when placed
in /etc/apt/apt.conf but I don't remember if this file still exists on the latest Raspbian.
User
avatar
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
Location: Romania
by phughes » Tue Oct 02, 2012 12:23 pm
Hi,
Thanks for the reply. Looks promising, but i'm not quite sure where exactly to add the line.
The structure i have is as follows;
/etc/apt/ contains 3 files (sources.list, trustdb.gpg & trusted.gpg)
/etc/apt/apt.conf.d contains 3 files (70debconf, 50raspi & 01autoremove)
/etc/apt/preferrences.d empty
/etc/apt/sources.list.d 1 file (raspi.list)
/etc/apt/trusted.gpg.d empty
Do I create a new file or use one of these?
Many thanks,
Pete
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK
by VAXXi » Tue Oct 02, 2012 12:25 pm
Create a new file in /etc/apt/apt.conf.d/ and name it "10proxy"; put inside the long line in my above post.
Aptget should work immediately after.
User
avatar
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 2/6
27/10/2016 Raspberry Pi • View topic Connect Raspi to a Proxy
Location: Romania
by phughes » Tue Oct 02, 2012 12:44 pm
Wonderful. Thank you :)
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK
by phughes » Wed Oct 03, 2012 1:24 pm
Internal proxy. For internet use.
I'm getting an error using dillo; DNS failed to resolve domain\username
I have changed the file /etc/environment to read as follows;
Code: Select all
export http_proxy="http://domain\username:password@proxyip:port/"
This looks like a syntax error with my code, any suggestions?
Cheers,
Pete
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK
by phughes » Thu Oct 04, 2012 7:16 am
Hi Guys,
Dillo doesn't like proxy servers I dont think. The above code works perfectly fine on the other richer
browsers.
Cheers,
Pete
Posts: 9
Joined: Tue Oct 02, 2012 8:55 am
Location: Colne, Lancashire, UK
by raspiworld » Fri Oct 05, 2012 3:53 pm
Hi guys,
I tried to go to the directory using "cd /etc/apt/apt.conf.d" but the terminal says "Not a directory"
To create the "10proxy" file there I have to go in there.
Cut and paste doesn't work, too. (Permission denied)
If I try to move the file to the Folder "apt.conf.d" using "mv 10proxy /etc/apt/apt.conf.d" the file goes to
"/etc/apt" and get the name "apt.conf.d".
I don't understand this. I just want to have a Internet connection on my Raspi.
Many thanks
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 3/6
27/10/2016 Raspberry Pi • View topic Connect Raspi to a Proxy
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm
by VAXXi » Fri Oct 05, 2012 7:54 pm
Not sure about what Linux distribution you're using, but try adding a "/" at the end of the path (after
apt.conf.d) and prefix the commands with sudo in order to make sure it's not a permission problem.
User
avatar
Posts: 9
Joined: Tue Sep 25, 2012 12:04 pm
Location: Romania
by raspiworld » Mon Oct 08, 2012 9:41 pm
Worked fine.
Thank you!
Posts: 3
Joined: Thu Sep 27, 2012 7:45 pm
by tsantosc123 » Thu Jan 23, 2014 12:37 am
Hello, I've created the "10proxy" file and put the line said by VAXXi in it, but I still can't access apt.
I think it's because I need an username and password to connect in my proxy server.
There's something I can do to include the username and password?
Thank you.
Posts: 1
Joined: Thu Jan 23, 2014 12:21 am
by DougieLawson » Thu Jan 23, 2014 1:01 am
At a guess
Code: Select all
Acquire::http::Proxy "http://yourusername:yourpassword@yourproxyaddress:yourproxyport";
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
RPi owner since '12.
Twitter: @DougieLawson
2B, B+, A+, 5Bs, zero, 3B
Please post ALL technical questions on the forum.Do not send private messages.
User
avatar
Posts: 23443
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 4/6
27/10/2016 Raspberry Pi • View topic Connect Raspi to a Proxy
by jneha » Mon May 26, 2014 2:59 pm
VAXXi wrote:apt seems to ignore the HTTP_PROXY environment variable.
You can make it work by putting
Code: Select all
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
in a file placed in /etc/apt/conf.d (named similar to "10proxy" for example). It should also work
when placed in /etc/apt/apt.conf but I don't remember if this file still exists on the latest
Raspbian.
Thank you. the aptget works in my Raspi by setting the proxy.. Thank you :)
Posts: 8
Joined: Sat May 24, 2014 7:26 am
by Chanderjeet » Tue Mar 08, 2016 11:50 am
I used these steps to get proxy up and running
https://www.raspberrypi.org/forums/view ... 99#p907699
then I create a blank file named 10proxy under /etc/apt/apt.conf.d and added this line :
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
It works like charm !
Posts: 5
Joined: Tue Feb 09, 2016 2:57 pm
by netitux » Wed Apr 20, 2016 4:03 pm
This works! Thanks!
Posts: 3
Joined: Sun Mar 08, 2015 5:15 pm
Search This Topic
Post a reply
17 posts
Return to Troubleshooting
Jump to: Troubleshooting Go
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 5/6
27/10/2016 Raspberry Pi • View topic Connect Raspi to a Proxy
Who is online
Users browsing this forum: Douglas6, pws, rpdom, Shraxton and 65 guests
Board index
The team
Delete all board cookies
All times are UTC
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=18634 6/6