[Linux]透過Proxy連線yum更新與取得檔案

1. 修改yum設定檔,加入proxy參數

vi /etc/yum.conf

--------------------

# The proxy server - proxy server:port number
proxy=http://proxy_ip:3128

# The account details for yum connections
proxy_username=username
proxy_password=password
--------------------

以上設定參數可提供所有帳號使用

2. 若要針對特定帳號使用,可以編輯使用者設定檔

vi ~/.bash_profile

-----------------

http_proxy=”http://proxy_ip:3128″
export http_proxy

--------------------

若 Proxy Server 需要經過帳號密碼驗證,則修改為下列參數

--------------------
http_proxy=http://username:password@proxy_ip:3128

export http_proxy
--------------------

3. 設定Wget 可以抓檔,編輯~/.wgetrc

vi ~/.wgetrc

--------------------



http_proxy =http://proxy_ip:3128
use_proxy = on
wait = 15

留言