$ export http_proxy="http://username:password@proxy:port/"; $ export https_proxy="http://username:password@proxy:port/";
Then run your normal commands and MOST things will pay attention to the environmental variables. Heck, you can even put it in your .bashrc or whatever else you automatically load into your environment on login.
But that doesn't work for other people... or automated processes. So every Cron you have has to go through that process. Many of those are unique and have their own settings files to reflect the proxy, and apt is no different. Apt is, however, easy to configure to use a proxy:
$ sudo vi /etc/apt/apt.conf
It will prompt you for your sudo password (if you're not already root). After that, you'll be editing the apt.conf file and if yours is anything like mine, it's empty. If it isn't empty, make sure you're not duplicating the info we're putting in there. Then enter in the following config lines, substituting your own info in. If your proxy doesn't have a username/password, you can skip the italic 'username:password@' section.
Acquire::http::proxy "http://username:password@proxy.example.com:port/"; Acquire::https::proxy "https://username:password@proxy.example.com:port/";
Save it, and make sure to run an 'apt-get update' to get the latest package lists and such. You should notice that it rolls right through them now that your system is able to talk out to the internet.
No comments:
Post a Comment