可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Following the MSYS2 first install steps described on http://msys2.github.io/, I received these errors. I want to get some utilities like vi
, vim
, bc
, gnuplot
. How do I configure pacman
to connect to the repositories?
My PC is on a corporate network. My browser connects to the web via a PAC script.
$ 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)
The following solution mentioned on a mailing list hasn't fixed the issue either.
1. Close MSYS2. 2. Run autorebase.bat 3. Open MSYS2 again.
回答1:
Fixed using a solution from the ArchLinux wiki
Located the proxy.pac
file in use at my company
In that file, identified the fall-thru proxy (i.e. domains not redirected elsewhere), defined as
return "PROXY zz-wwwproxy-90-v:8080";
- Added this to my MSYS2 shell environment:
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"
回答2:
Under root directory of msys there is network.xml
file.
You can use this to give proxy address/port
and user name/password
.
回答3:
I came across this issue while trying to install the RubyInstaller Development Kit on Windows.
Could not get this to work by setting the proxy details in the bash profile, network.xml file or the environment variables.
Was able to get it working with the following:
- Open:
<msys_install_directory>\etc\wgetrc
- Locate the section to set default proxies
- Uncomment lines and update with your proxy details
The above should work but I also performed the following to help debug the pacman issue:
- Open:
<msys_install_directory>\etc\pacman.conf
- Locate the line:
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
- Remove the comment
It's not the best solution but I got the dev kit installed.
Note: The environment variables were set when I finally got it to work. These are best instructions I could find for setting proxy env variables: https://avocode.zendesk.com/hc/en-us/articles/203402352-How-to-use-a-proxy-server.