
我偶然發現我的 CentOS7 伺服器有一個小問題。它是代理後面的虛擬伺服器,可以連接到互聯網,但不能使用 yum。每當我嘗試時,我都會收到錯誤:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?
release=7&arch=x86_64&repo=os&infra=stock error was
14: HTTP Error 407 - Proxy Authentication Required
即使我配置了代理/etc/環境:
http_proxy='http://user:password@url:8088/'
HTTP_PROXY='http://user:password@url:8088/'
https_proxy='http://user:password@url:8088/'
HTTPS_PROXY='http://user:password@url:8088/'
ftp_proxy='http://user:password@url:8088/'
FTP_PROXY='http://user:password@url:8088/'
no_proxy='localhost,127.0.0.1,localaddress,*.localdomain.com,*.bl.ch,10.*'
NO_PROXY='localhost,127.0.0.1,localaddress,*.localdomain.com,*.bl.ch,10.*'
並在/etc/yum.conf:
proxy=http://url:8088/
proxy_username=user_name
proxy_password=password
我甚至在/root/.bash_profile:
export http_proxy="http://url:8088/"
並在/etc/wgetrc:
http_proxy='http://user:password@url:8088/'
HTTP_PROXY='http://user:password@url:8088/'
https_proxy='http://user:password@url:8088/'
HTTPS_PROXY='http://user:password@url:8088/'
ftp_proxy='http://user:password@url:8088/'
FTP_PROXY='http://user:password@url:8088/'
no_proxy='localhost,127.0.0.1,localaddress,*.localdomain.com,*.bl.ch,10.*'
NO_PROXY='localhost,127.0.0.1,localaddress,*.localdomain.com,*.bl.ch,10.*'
我真的不明白它怎麼仍然缺少身份驗證;有人知道如何解決這個問題嗎?