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 Portage trees 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 Portage tree. 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 a own local rsync mirror is just a matter of configuring the daemon to make the  directory available for syncing. Create the following configuration file:

The  and   options are not needed. By default, 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 for more information.

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

It is time to test the rsync mirror. It is not necessary to test from another machine but it would be a good idea to do so. If the server is not known by hostname from all computers, use its associated IP address instead.

The content of should be visible on the mirror.

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 the own local rsync mirror instead of a public one using the Project:Portage/Sync file.