Connecting Raspberry Pi through school proxy

A post to file under ‘boringly technical’,  but it’s here for anyone in the same situation.

pi desktop

I’ve been struggling to get the Raspberry Pi to fully access the internet in my classroom as it has to connect through a proxy server. I have so far been able to connect through the browser by changing the proxy setting in Midori, but had no luck in enabling a connection that allowed for apt-get commands through the terminal. As with most things relating to the Pi this process was not intuitive, but all the more satisfying for requiring a bit of digging, thus extending my limited technical knowledge.

This lunch time I sat down determined to find the solution and, with the help of various forums and the Raspberry Pi User Manual I successfully managed to achieve a connection. (This is using a wired ethernet connection – I haven’t tested it over wifi). There may be a smarter way, but this is how I did it:

1. Setup a password for the root account by opening up a terminal and using the command: sudo passwd root

2. Restart the pi and login as user: root with your new password (logging in as root will allow you to alter the following file – user ‘pi’ does not have this privilege).


3. Navigate to the folder /etc/apt/apt.conf.d/ (You can do this by clicking the second icon along on the taskbar at the bottom of your desktop and typing in the location address).

4. Right click in the folder and create a new file called ’10proxy’.

5. Right click on the new file and edit it. Type in the following line:

Acquire::http::Proxy ““;

(obviously changing the bit in bold for your school’s proxy setting)

6. Save the file.

7. Restart the pi and log back in as user: pi   password: raspberry (or whatever your default user account is set as)

You should now find that you have full internet access. You can test by trying an update in the terminal:

sudo apt-get update

Done. Hurrah!


Leave a Reply