看板 Linux 關於我們 聯絡資訊
我的系統是ubuntu server 12.04 因為公司網路關係有使用proxy (設在/etc/environment) 現在問題是,如果我不是root,我打sudo apt-get update 會發生下列事情: Err http://security.ubuntu.com precise-security InRelease Err http://free.nchc.org.tw precise InRelease Err http://free.nchc.org.tw precise-updates InRelease Err http://security.ubuntu.com precise-security Release.gpg Temporary failure resolving 'security.ubuntu.com' Err http://free.nchc.org.tw precise-backports InRelease Err http://free.nchc.org.tw precise Release.gpg Temporary failure resolving 'free.nchc.org.tw' Err http://free.nchc.org.tw precise-updates Release.gpg Temporary failure resolving 'free.nchc.org.tw' Err http://free.nchc.org.tw precise-backports Release.gpg Temporary failure resolving 'free.nchc.org.tw' Reading package lists... Done W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise/InRelease W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise-updates/InRelease W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise-backports/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Temporary failure resolving 'security.ubuntu.com' W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'free.nchc.org.tw' W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise-updates/Release.gpg Temporary failure resolving 'free.nchc.org.tw' W: Failed to fetch http://free.nchc.org.tw/ubuntu/dists/precise-backports/Release.gpg Temporary failure resolving 'free.nchc.org.tw' W: Some index files failed to download. They have been ignored, or old ones used instead. 但是如果我用root,我直接打apt-get update 就會正常的get,get,get,get...... 但是如果我用root,指令是打sudo apt-get update 又會出現上述的error 請問這是什麼情況?? 看起來像dns解析的問題,要怎麼改?? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.222.86.99 ※ 文章網址: http://www.ptt.cc/bbs/Linux/M.1407913991.A.E49.html
FrankWOO: 自問自答,用root帳號執行apt-get install sudo 08/13 15:19
goldie: 應該是你的 proxy 環境變數沒被 sudo 繼承下去 08/13 23:52
goldie: 請打 sudo visudo 後,鍵入一行: 08/13 23:53
goldie: Defaultsenv_keep+="http_proxy https_proxy ftp_proxy" 08/13 23:54
goldie: Defaults env_keep+="http_proxy https_proxy ftp_proxy" 08/13 23:54
goldie: Sorry, 第一個少一個空白,請忽略。 08/13 23:55
goldie: 引號內請換成你真正新增的proxy變數,空白格開。 08/13 23:56