HOW TO:Portage Mirror

From 0xWIKI
Jump to: navigation, search

The following steps will help you make your Gentoo machine into a portage mirror.

  1. If you do not have 'rsync', you must install it.
  2. emerge rsync
    
  3. You must edit '/etc/rsyncd.conf' to set up the mirror.
  4. vim /etc/rsyncd.conf
    
    1. In that file there should be a commented block for setting up a gentoo portage mirror. You need to uncomment that. Your file should look like the following.
    2. # /etc/rsyncd.conf
      
      # Minimal configuration file for rsync daemon
      # See rsync(1) and rsyncd.conf(5) man pages for help
      
      # This line is required by the /etc/init.d/rsyncd script
      pid file = /var/run/rsyncd.pid
      use chroot = yes
      read only = yes
      
      # Simple example for enabling your own local rsync server
      [gentoo-portage]
              path = /usr/portage
              comment = Gentoo Portage tree
              exclude = /distfiles /packages
      
    3. Now you need to restart rsync for the changes to take effect.
    4. /etc/init.d/rsyncd restart
      
      1. If you have not already added rsyncd to a runlevel, you probably should.
      2. rc-update add rsyncd default
        
  5. If you are using 'iptables', you must allow connections to the port used by rsync. If traffic to port 873 is currently not allowed, make it so.
  6. # Permit rsync connections
    iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 873 -j ACCEPT
    
  7. Finally, to use your new mirror from another Gentoo machine, you must set it as the rsync server on the client machine. On the client machine, add this line to '/etc/make.conf' (replace x's with your rsync mirror's ip):
  8. SYNC="rsync://xxx.xxx.xxx.xxx/gentoo-portage"
    
Personal tools