Setting proxy for apt from terminal [duplicate]
Solution 1:
Okay just solved it. Adding following line to /etc/apt/apt.conf
has solved the problem:
Acquire::http::proxy "http://10.1.3.1:8080/";
If file does not exist, create it. Do not confuse it with apt.conf.d directory.
Solution 2:
The file:
/etc/environment
Is the correct place to specify system-wide environment variables that should be available to all processes. See https://help.ubuntu.com/community/EnvironmentVariables for details. Note that this is not a script file but a configuration file.
If you want this for the specified command only, use (as root):
http_proxy=http://10.1.3.1:8080 apt-get update
Solution 3:
Edit your:
gedit /etc/profile
Enter the details in this format.
export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/
Then run the
sudo apt-get update
That should do it for you.
As stated above you can enter the proxy into apt.conf (Piyush Credit)