If you use a college campus network or company intranet, you can use a proxy account to access the Internet. In this case, how can I use the agent to update (apt-get) or download In debian or Ubuntu. Method 1: This is a temporary method. If you only need to use apt-get through http Proxy temporarily, you can use this method. Before using apt-get, enter the following command in the terminal (replace yourproxyaddress and proxyport according to your actual situation; if you do not need a proxy account and password, please
If you use a college campus network or company intranet, you can use a proxy account to access the Internet. In this case, how can I use the agent to update (apt-get) or download In debian or Ubuntu.
Method 1:
This is a temporary method. If you only need to use apt-get through http Proxy temporarily, you can use this method.
Before using apt-get, enter the following command in the terminal (replace yourproxyaddress and proxyport according to your actual situation; if you do not need a proxy account or password, remove proxyusr: password ).
It is said that the proxy is canceled
Export http_proxy = ""
You can.
Method 2:
This method requires the apt. conf file in the/etc/apt/folder. If you want apt-get (instead of other applications) to always use http proxy, you can use this method.
Note: In some cases, the apt configuration file is not created during system installation. The following operations modify the existing configuration file or create a new configuration file as needed.
Sudo gedit/etc/apt. conf Add the following line to your apt. conf file (replace yourproxyaddress and proxyport according to your actual situation ).
Acquire: http: Proxy "http: // proxyusr: password @ yourproxyaddress: proxyport"; Save the apt. conf file.
Method 3:
This method adds two lines to the. bashrc file in your home directory. If you want apt-get and other applications such as wget to use http proxy, you can use this method.
Gedit ~ /. Bashrc Add the following content at the end of your. bashrc file (replace yourproxyaddress and proxyport according to your actual situation ).
Http_proxy = http: // proxyusr: password @ yourproxyaddress: proxyport
Export http_proxy saves the file. Close the current terminal and open another terminal.
Use apt-get update or any network tool you want to use to test the proxy. I use firestarter to view active network connections.
If you modify the configuration file again to correct the error, close the terminal and open it again.