Difference between revisions of "Local repository"

From ArchWiki
Jump to navigation Jump to search
m (updated to pacman -Syu)
m (chmod 777 is bad mmmkay?)
Line 71: Line 71:
   wget -N ftp://ftp.archlinux.org/extra/'''.db.'''
   wget -N ftp://ftp.archlinux.org/extra/'''.db.'''
*chmod 777 /bin/alsync
*chmod 755 /bin/alsync
copy this file to your clients
copy this file to your clients

Revision as of 02:21, 21 November 2013

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Local repository#)

Merge-arrows-2.pngThis article or section is a candidate for merging with pacman Tips.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Local repository#)

This document outlines one way to share Arch Linux packages across a LAN. A better way to do this would be to create a Custom local repository with ABS and gensync and make the repository available across the LAN using NFS or FTP. This document should be edited to describe this process in detail. For the time being, the original HOWTO is left intact below:


Sharing all of your downloaded packages to your LAN can save bandwidth, diskspace, and time.

pacman -Syu

Will sync against our local repository;

pacman -S pkgname 

Will try to download and install a package from localserver. If the package does not exist it will download it from the next server in the list /etc/pacman.conf and save the package on localserver;


Will update localserver database against ftp.archlinux.org.

In example: for my network


Adjust to your needs.

On the Server Side

Create an NFS share on the server hosting the packages.

For detailed help on setting up an NFS server please see NFS

  • Add this line to /etc/exports:
  • If you modify /etc/exports while the server is running, you must re-export them for changes to take effect:
# exportfs -ra

On all clients

  • Rename /var/cache/pacman/pkg to /var/cache/pacman/pkgorg.
  • Create a new /var/cache/pacman/pkg and mount the nfs share there.
  • Run:
mount -o rw,nolock /var/cache/pacman/pkg
  • If the mount from command line does not work add this option:
  • Or, if you want it automount after the reboot, add this line in /etc/fstab: /var/cache/pacman/pkg    nfs    rw,nolock
  • Again, if the mount does not work, try to add mount option nfsvers=3 to the fstab entry.
  • Run:
mount -a
  • Run:

To check mount.

  • Move all your already fetched pkg from your clients:
 /var/cache/pacman/pkgorg to /var/cache/pacman/pkg
  • Edit /etc/pacman.conf and add this lines directly after the line:
 Server = file:///var/cache/pacman/pkg

and after

 Server = file:///var/cache/pacman/pkg

I have skipped the step 3 because for me it works as i want already. I sync from each PC and all share the pacman cache.

To sync your local repository against archlinux.org

  • "alsync" connects, logs in, and updates your packages database on the local nfs server
 pacman -S openssl
 pacman -S wget

  • create a file called /bin/alsync and add these lines
 cd /var/cache/pacman/pkg
 wget -N ftp://ftp.archlinux.org/current/.db.
 wget -N ftp://ftp.archlinux.org/extra/.db.
  • chmod 755 /bin/alsync

copy this file to your clients

  • Attempt to run as root on the first client
 pacman -Syu
 pacman -S new-pkgname
  • Then move to the next client and run
 pacman -Syu
 pacman -S new-pkgname