Local Mirror

This page contains information on how to run a private, local Gentoo rsync mirror.

Setting up the mirror
Many users run Gentoo on several machines and need to sync the Gentoo repository on all of them. Using public mirrors is simply a waste of bandwidth at both ends. Syncing only one machine against a public mirror and all others against that computer would save resources on the public mirrors and save users' bandwidth.

The same holds true for organizations who would like to control the rsync mirror their servers and workstations sync against. Of course, they usually also want to save on bandwidth and traffic costs.

Select which machine is going to be the local rsync mirror and set it up. Choose a computer that can handle the CPU and disk load that an rsync operation requires. The local mirror also needs to be available whenever any of the other computers syncs its ebuild repository. Besides, it should have a static IP address or a name that always resolves to the server. Configuring a DHCP and/or a DNS server is beyond the scope of this guide.

Setting up the server
There is no extra package to install as the required software is already on the computer. Setting up your own local rsync mirror is just a matter of configuring the daemon to make the Gentoo repository directory available for syncing.

Currently, the Gentoo repository is now located by default at:. Older legacy installations used. Please be sure to enter the proper path in the following example. Create a configuration file such as this:

The  and   settings are optional and not needed. Without them, all clients will be allowed to connect to the mirror. The order in which the options are written is not relevant. The server will always check the  option first and grant the connection if the connecting host matches any of the listed patterns. The server will then check the  option and refuse the connection if any match is found. Any host that does not match anything will be granted a connection. Please read the man page if you desire more advanced configuration information.

Service
Now, start the rsync daemon with the following command as the root user:

Testing the server
It is time to test the rsync mirror. Test first locally and then again from the desired other machine.

Perform the following tests, using the local IP of your own machine, or its hostname. If the hostname can not be resolved by all computers, just refer to it by IP address instead.

This one-line response indicates good communication with the configured rsync server.

The content of should be visible on the mirror.

If the tests are unsuccessful, make sure the rsyncd service was actually started, there are no errors in the config file, and a local firewall is not blocking rsyncd's TCP port 873.

If the tests ARE successful, The rsync mirror is now set up.

Running on this system will keep the server up-to-date. If cron or similar facilities to sync regularly, remember to keep it down to a sensible frequency like once or twice a day.

Configuring the clients
Now, make the other computers use your own local rsync mirror instead of a public one, by changing the sync-uri entry in the appropriate file in Project:Portage/Sync