In Ubuntu 14.04, in order to use some commands in terminal (like apt-get) trough the company proxy, I need to do the following changes, beyond System Settings > Network > Network proxy > "Apply system wide" (shame on you, Ubuntu)
/etc/environment (actually this is the only file modified by System Settings)
http_proxy="http://[webproxy]:[port]/"
https_proxy="https://[webproxy]:[port]/"
ftp_proxy="ftp://[webproxy]:[port]/"
socks_proxy="socks://[webproxy]:[port]/"
/etc/profile
export http_proxy=http://[username]:[password]@[webproxy]:[port]
export https_proxy=http://[username]:[password]@[webproxy]:[port]
export ftp_proxy=http://[username]:[password]@[webproxy]:[port]
sudo visudo
Defaults env_reset
Defaults env_keep = "http_proxy https_proxy ftp_proxy DISPLAY XAUTHORITY"
/etc/apt/apt.conf
Acquire::http::proxy "http://[username]:[password]@[webproxy]:[port]/";
Acquire::https::proxy "https://[username]:[password]@[webproxy]:[port]/";
Acquire::ftp::proxy "ftp://[username]:[password]@[webproxy]:[port]/";
Acquire::socks::proxy "socks://[username]:[password]@[webproxy]:[port]/";
or the same changes in
/etc/apt/apt.conf.d/95proxies
I think that at least the following command (from here)
sudo http_proxy='http://[username]:[password]@[webproxy]:[port]' apt-get update
should work, right?
That's what I remember right now. Not even sure if all of them are really necessary. I did all these changes in Ubuntu 16.04, though, but still can't make sudo apt-get update
work through the same proxy (another computer in the same room). Got
Temporary failure resolving '[webproxy]'
What am I missing?
Create a new empty conf file: $ sudo vi /etc/apt/apt.conf
Add this line to the file if you are using http proxy else https of ftp:Acquire::http::Proxy "http://user:pass@proxy_host:port";
If you don't have a usename and password for your proxy then write:Acquire::http::Proxy "http://proxy_host:port";
Note: don't miss the semicolon at the end of line.
I had the same problem and I fix it following this solution: https://www.unixmen.com/45713-2/ from M.el Khamlichi
create a file apt.conf in /etc/apt/
sudo vi /etc/apt/apt.conf
add there the proxy
export http_proxy=http://192.168.168.180:3128
Here you wil put your numbers.
add it to ~/.bash.rc to make this command permanent
vi ~/.bash.rc
The only thing that worked for me in Ubuntu Desktop was to
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With