Method: 1. Use the "vi /etc/yum.conf" command to add a proxy under "yum.conf"; 2. Use the "vi /etc/wgetrc" command to add "http_proxy=IP:PORT ftp_proxy =IP:PORT" to set the proxy.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
1. yum proxy setting
You can add a proxy under yum.conf through the command vi /etc/yum.conf.
After setting up, you can successfully execute the command: yum install package name
2, wget proxy setting
Same as above, add it through the command vi /etc/wgetrc acting.
Add the following two lines of code:
http_proxy=IP:PORT
ftp_proxy=IP:PORT
3. System environment proxy settings
Passed vi ~/.bashrc Add the following three lines
export http_proxy="http://IP:PORT"
export https_proxy="http:// IP:PORT"
export ftp_proxy=$http_proxy
Execute source ~/.bashrc after saving and exiting.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to set up proxy in linux. For more information, please follow other related articles on the PHP Chinese website!