Ubuntu 16.04 apt-get not working through proxy server

In Ubuntu 14.04, in order to use some commands in the terminal (for example, apt-get) through the company proxy, I need to make the following changes, except for the system settings> Network> Network proxy> "Apply the whole system" (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 at least the following command (from here )

sudo http_proxy='http://[username]:[password]@[webproxy]:[port]' apt-get update

should work, right?

What I remember right now. I’m not even sure that all of them are really necessary. However, I made all these changes in Ubuntu 16.04, but still I can’t make it sudo apt-get updatework through the same proxy (another computer in the same room). there is

Temporary failure resolving '[webproxy]'

What am I missing?

+4
2

conf: $ sudo vi /etc/apt/apt.conf

, http proxy else https ftp:
Acquire::http::Proxy "http://user:pass@proxy_host:port";

-, :
Acquire::http::Proxy "http://proxy_host:port";
: .

+4

, : https://www.unixmen.com/45713-2/ M.el Khamlichi

  • apt.conf /etc/apt/

    sudo vi /etc/apt/apt.conf
    
  • export http_proxy=http://192.168.168.180:3128 
    

    .

  • ~/.bash.rc,

    vi ~/.bash.rc
    

, !
?
?
.

+1

Source: https://habr.com/ru/post/1649166/


All Articles