This post was originally published on go2linux.org, a Linux blog I ran from 2007 to 2011. The domain is no longer mine, but I am the original author. I am republishing it here on garron.me with corrections and improvements.
If you need to install or update an Arch Linux package and you are behing a proxy, there is a way to quickly configure it to use that proxy.
This will not be permanent, so it is great to use with Laptops, to set a momentary proxy server.
To set the http proxy enter in the console
su -
To switch to root, as root is the user that is able to run pacman
export http_proxy='http://127.0.0.1:8123'
To set the ftp proxy enter in the same console window
export ftp_proxy='http://127.0.0.1:8123'
be sure to use the appropriate IP and port according to your environment.
Edit 09/18/09
Thanks to the comment below, I have noticed that this was missing, here is the answer to that comment:
export http_proxy='http://username:[email protected]:3128'
export ftp_proxy='http://username:[email protected]:3128'
Enter the correct username, password, IP and port.