2015-04-21 112 views
16

http://msys2.github.io/上描述的MSYS2首次安裝步驟後,我收到了這些錯誤。我想獲得一些實用程序,如vi,vim,bc,gnuplot。我如何配置pacman連接到存儲庫?MSYS2 pacman無法通過公司防火牆更新軟件包

我的電腦在公司網絡上。我的瀏覽器通過PAC腳本連接到Web。

$ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime 

:: Synchronizing package databases... 
error: failed retrieving file 'mingw32.db' from downloads.sourceforge.net  : Connection timed out after 10000 milliseconds 
error: failed to update mingw32 (download library error) 
error: failed retrieving file 'mingw64.db' from downloads.sourceforge.net : Connection timed out after 10000 milliseconds 
error: failed to update mingw64 (download library error) 
error: failed retrieving file 'msys.db' from downloads.sourceforge.net : Connection timed out after 10000 milliseconds 
error: failed to update msys (download library error) 
error: failed to synchronize any databases 
error: failed to init transaction (download library error) 

mailing list上提到的以下解決方案也未解決問題。

1. Close MSYS2. 
2. Run autorebase.bat 
3. Open MSYS2 again. 
+0

也試過'pacman-key --init'但是沒有幫助。我在'/ etc/pacman.conf'中猜測一些配置設置,或者需要'/ etc/network'。 – ropata

+0

在[askubuntu.com]找到了幾個不完整的答案(http://askubuntu.com/questions/104950/how-do-i-configure-apt-get-to-use-a-pac-file-for -a-proxy)和[superuser.com](http://superuser.com/questions/323488/ubuntu-system-wide-proxy-auto-configuration-pac-script)。 – ropata

回答

30

使用從ArchLinux wiki

  1. 解決坐落在proxy.pac文件在使用中我公司

  2. 在該文件中固定的,確定的秋天,直通代理(即域不是重定向定義爲

return "PROXY zz-wwwproxy-90-v:8080"; 
  • 將此添加到我的MSYS2殼環境:
  • export http_proxy=<myusername>:<mypassword>@proxy-host-name:8080 
    export https_proxy=$http_proxy 
    export ftp_proxy=$http_proxy 
    export rsync_proxy=$http_proxy 
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" 
    
    +0

    維基上有一些更優雅的解決方案,但上面的快速和骯髒的方法似乎工作OK :) – ropata

    +1

    謝謝,它的工作原理! – smwikipedia

    +0

    順便說一句,你可以用'pacman -S base'和'pacman -S base-devel'安裝一堆工具。 – ropata

    4

    在MSYS的根目錄下有network.xml文件。

    你可以用這個來給proxy address/portuser name/password

    +5

    標籤中需要顯示什麼? – ARM

    5

    我在嘗試在Windows上安裝RubyInstaller開發工具包時遇到了此問題。

    無法通過在bash配置文件,network.xml文件或環境變量中設置代理服務器詳細信息來使其工作。

    能得到它具有以下工作:

    • 公開賽:<msys_install_directory>\etc\wgetrc
    • 找到設置默認代理
    • 取消註釋行的部分和更新您的代理信息

    以上應該工作,但我也執行以下幫助調試pacman問題:

    • 公開賽:<msys_install_directory>\etc\pacman.conf
    • 找到行:#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    • 刪除註釋

    這是不是最好的解決辦法,但我安裝了開發工具包。

    注意:環境變量是在我最終使用它時設置的。這些是我可以找到的用於設置代理環境變量的最佳說明:https://avocode.zendesk.com/hc/en-us/articles/203402352-How-to-use-a-proxy-server

    +1

    如果您正在嘗試安裝> Ruby 2.4的開發工具包,那麼這是目前爲止唯一適用於我的解決方案。 – thegreendroid