Gentoo Wiki




Gentoo has the mirrorselect utility, which allows you to select a fast mirror. However it does not cover all cases, especially not files that reside outside the Gentoo mirrors. Also, the load or connection speed on the mirrors may have changed since mirrorselect was last called.

The idea is to make the download fail if the mirror turns out to be slow. Portage will then attempt to use another one until it finds a mirror that is sufficiently fast.




The default fetch command will be replaced with curl. In this case we will set a lower limit of 200 kB/s for the mirror. Adjust it for your Internet connection.

File: /etc/make.conf
  FETCHCOMMAND="/usr/bin/curl -Y 200000 --connect-timeout 30 -f --output \${DISTDIR}/\${FILE} \${URI}"
  RESUMECOMMAND="/usr/bin/curl -Y 200000 -C - --connect-timeout 30 -f --output \${DISTDIR}/\${FILE} \${URI}"


-Y 200000             set a speed limit of 200000 Bytes per second, adjust this to the minimum speed that you want
-y seconds            (not used in this example) timeframe to determine the download speed, 30 seconds is the default
--connect-timeout 30  wait up to 30 seconds for a reply from the server
--retry num           (not used in this example) try to reconnect up to the specified number of times to the server on failure
-f                    do not download 404 error pages from http servers


Retrieved from ""

Last modified: Fri, 05 Sep 2008 22:10:00 +0000 Hits: 433