Running a Linux box and using “apt-get” command behind a proxy that requires authentication is really painful, you will need to make some configuration to get full internet access. Let me explain you how to get rid of it. First, Open your terminal and add these lines (given below) to the “.bashrc” file. It will set proxy for wget, http, https and ftp access.
1 2 3 | # vi ~/.bashrc |
1 2 3 4 5 6 7 8 | # for wget proxy alias wget='wget --proxy-user= --proxy-password=' export http_proxy="http://:@:" export https_proxy="https://:@:" export ftp_proxy="ftp://:@:" |
Then execute the .bashrc file using source command to make change active.
1 2 3 | source ~/.bashrc |
Now, you have to add proxy setting for “apt-get” command also by adding these lines(given below) in the “apt.conf” file. If you don’t do it you may not be able to update or install new packages using “apt-get” command.
1 2 3 | # vi /etc/apt/apt.conf |
1 2 3 4 5 6 | Acquire::http::proxy "http://:@:"; Acquire::https::proxy "https://:@:"; Acquire::ftp::proxy "ftp://:@:"; Acquire::socks::proxy "socks://:@:"; |
NOTE: This is really insecure as you will now have your proxy user id and password simple readable text format.