ubuntu apt-get update using proxy

The unit network uses a proxy server to access the Internet. After setting the proxy in Network--Proxy Server, Chrome can access the Internet. But using the apt-get command cannot update the software, and even the source cannot be linked.

According to the settings on the Internet, the settings under
export http_proxy=http://yourproxyaddress:proxypor

~ ./.bash.rc were unsuccessful.

The final solution is as follows:

create a file apt-proxy-conf (optional name) under /etc/apt/, and edit the content as follows:
Acquire::http::proxy "http://proxy3.bj.petrochina:8080/";
Acquire::ftp::proxy "ftp://proxy3.bj.petrochina:8080/";
Acquire::https::proxy "https://proxy3.bj.petrochina:8080/";


Update execution:
sudo apt-get update -c apt-proxy-conf

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326831437&siteId=291194637