To enable package manager updates via proxy:
echo 'Acquire::http::Proxy "http://proxy5b.openu.ac.il:80/";' | sudo tee /etc/apt/apt.conf.d/99proxy
echo 'Acquire::https::Proxy "https://proxy5b.openu.ac.il:80/";' | sudo tee -a /etc/apt/apt.conf.d/99proxyVerify the configuration:
cat /etc/apt/apt.conf.d/99proxyThen update:
sudo apt updateTo apply proxy settings globally:
- Edit
.bashrc:nano ~/.bashrc - Add the following lines:
export http_proxy="http://proxy5b.openu.ac.il:80" export https_proxy="https://proxy5b.openu.ac.il:80" export ftp_proxy="http://proxy5b.openu.ac.il:80" export no_proxy="localhost,127.0.0.1"
- Apply changes:
source ~/.bashrc
If WSL still has issues connecting:
export http_proxy=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):80
export https_proxy=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):80Test connectivity:
curl -I https://www.google.com
wget --spider https://www.google.comIf a 200 OK response appears, the proxy is set up correctly.
For persistence across reboots, add the proxy settings to ~/.profile as well.