Difference between revisions of "Local repository"

From ArchWiki
Jump to: navigation, search
(removed parts about tcp_wrappers (deprecated))
Line 1: Line 1:
 
[[Category:Package management (English)]]
 
[[Category:Package management (English)]]
 
{{i18n|Local repository HOW-TO}}
 
{{i18n|Local repository HOW-TO}}
 +
{{Expansion}}
 +
{{Merge|pacman Tips}}
  
 
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:
 
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:
  
 +
== Introduction ==
 
To share all your downloaded packages in your lan
 
To share all your downloaded packages in your lan
 
Pros  save bandwidth, diskspace and time.
 
Pros  save bandwidth, diskspace and time.
"pacman -Sy"  will sync against our local repository
+
pacman -Sy
"pacman -S pkgname" try to download and install pkg from localserver if pkg not exist it download
+
Will sync against our local repository;
from the next server in the list /etc/pacman.conf and save pkg on localserver.
+
pacman -S pkgname  
"alsync" will update localserver db against ftp.archlinux.org
+
Try to download and install pkg from localserver if pkg not exist it download from the next server in the list /etc/pacman.conf and save pkg on localserver;
 +
alsync
 +
Will update localserver db against ftp.archlinux.org.
  
ex. for my network
+
Ex. for my network
serverip=192.168.14.3
+
serverip=192.168.14.3
network=192.168.14.0/255.255.255.0
+
network=192.168.14.0/255.255.255.0
adjust to yours
+
Adjust to yours.
  
  
== on the server side ==
+
== On the server side ==
on your server create an nfs share readwrite for all pc on your lan
+
On your server create an nfs share readwrite for all pc on your lan.
  
If you run Arch Linux on the server you can
+
If you run Arch Linux on the server you can:
 +
*Run these commands:
 
   pacman -S rpcbind
 
   pacman -S rpcbind
 
   pacman -S nfs-utils
 
   pacman -S nfs-utils
  
edit /etc/exports
+
*Edit /etc/exports.
add line
+
*Add line:
 
  /var/cache/pacman/pkg 192.168.14.0/255.255.255.0(rw,no_root_squash,sync)
 
  /var/cache/pacman/pkg 192.168.14.0/255.255.255.0(rw,no_root_squash,sync)
add rpcbind, nfs-common and nfs-server to DAEMONS in /etc/rc.conf
+
*Add rpcbind, nfs-common and nfs-server to DAEMONS in /etc/rc.conf.
  
run the followings:
+
*Run the followings:
 
   # /etc/rc.d/rpcbind start
 
   # /etc/rc.d/rpcbind start
 
   # /etc/rc.d/nfs-common start
 
   # /etc/rc.d/nfs-common start
 
   # /etc/rc.d/nfs-server start
 
   # /etc/rc.d/nfs-server start
check the nfsshare run "exportfs" on server.
+
*Check the nfsshare run "exportfs" on server.
  
== on all clients==
+
== On all clients==
*rename /var/cache/pacman/pkg  to /var/cache/pacman/pkgorg
+
*Rename /var/cache/pacman/pkg  to /var/cache/pacman/pkgorg.
*create a new /var/cache/pacman/pkg and mount the nfs share there
+
*Create a new /var/cache/pacman/pkg and mount the nfs share there.
*run "mount -o rw,nolock 192.168.14.3:/var/cache/pacman/pkg /var/cache/pacman/pkg"
+
*Run:
*if the mount from command line does not work add this option "nfsvers=3"
+
mount -o rw,nolock 192.168.14.3:/var/cache/pacman/pkg /var/cache/pacman/pkg
or if you want it automount after the reboot,
+
*If the mount from command line does not work add this option:
add this line in /etc/fstab
+
nfsvers=3
 +
*Or, if you want it automount after the reboot, add this line in /etc/fstab:
 
   192.168.14.3:/var/cache/pacman/pkg /var/cache/pacman/pkg    nfs    rw,nolock
 
   192.168.14.3:/var/cache/pacman/pkg /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.
+
*Again, if the mount does not work, try to add mount option nfsvers=3 to the fstab entry.
*run "mount -a"
+
*Run:
*run "df" to check mount
+
mount -a
*move all your already fetched pkg from your clients
+
*Run:
 +
df
 +
To check mount.
 +
*Move all your already fetched pkg from your clients:
 
   /var/cache/pacman/pkgorg to /var/cache/pacman/pkg
 
   /var/cache/pacman/pkgorg to /var/cache/pacman/pkg
*edit /etc/pacman.conf and add this lines directly after the line
+
*Edit /etc/pacman.conf and add this lines directly after the line:
  
 
   {current}
 
   {current}

Revision as of 10:56, 7 September 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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:

Introduction

To share all your downloaded packages in your lan Pros save bandwidth, diskspace and time.

pacman -Sy

Will sync against our local repository;

pacman -S pkgname 

Try to download and install pkg from localserver if pkg not exist it download from the next server in the list /etc/pacman.conf and save pkg on localserver;

alsync

Will update localserver db against ftp.archlinux.org.

Ex. for my network

serverip=192.168.14.3
network=192.168.14.0/255.255.255.0

Adjust to yours.


On the server side

On your server create an nfs share readwrite for all pc on your lan.

If you run Arch Linux on the server you can:

  • Run these commands:
 pacman -S rpcbind
 pacman -S nfs-utils
  • Edit /etc/exports.
  • Add line:
/var/cache/pacman/pkg 192.168.14.0/255.255.255.0(rw,no_root_squash,sync)
  • Add rpcbind, nfs-common and nfs-server to DAEMONS in /etc/rc.conf.
  • Run the followings:
 # /etc/rc.d/rpcbind start
 # /etc/rc.d/nfs-common start
 # /etc/rc.d/nfs-server start
  • Check the nfsshare run "exportfs" on server.

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 192.168.14.3:/var/cache/pacman/pkg /var/cache/pacman/pkg
  • If the mount from command line does not work add this option:
nfsvers=3
  • Or, if you want it automount after the reboot, add this line in /etc/fstab:
 192.168.14.3:/var/cache/pacman/pkg /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:
df

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:
 {current}
 Server = file:///var/cache/pacman/pkg

and after

 {extra}
 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 v.s. archlinux.org

  • "alsync" connects, login, and update your packages database on the local nfsserver
 pacman -S openssl
 pacman -S wget


  • create a file called /bin/alsync and put in this lines
 cd /var/cache/pacman/pkg
 wget -N ftp://ftp.archlinux.org/current/.db.
 wget -N ftp://ftp.archlinux.org/extra/.db.
  • chmod 777 /bin/alsync

copy this file to your clients

  • to try run as root on first client
 alsync
 pacman -Sy
 pacman -S new-pkgname
  • move to next client and run
 pacman -Sy
 pacman -S new-pkgname