Difference between revisions of "Pacserve"

From ArchWiki
Jump to: navigation, search
m (categorize, slightly improve style (would require more fixes))
m (added AUR link)
(5 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
==Installation==
 
==Installation==
You can either install pacserve manually from the [[AUR]], or with the following method:
+
You can either install {{AUR|pacserve}} manually from the [[AUR]], or with the following method.
  
===from Xyne's repository===
+
====From Xyne's repository====
add this to your /etc/pacman.conf, replace (x86_64 with i686 or any if necessary):
+
Xyne is the author of pacserve, you can directly use his repository by adding the following to your ''pacman.conf''.
[xyne-x86_64]
+
# A repo for Xyne's own projects: http://xyne.archlinux.ca/projects/
+
SigLevel = Required
+
Server = http://xyne.archlinux.ca/repos/xyne
+
  
now install pacserve:
+
{{hc|/etc/pacman.conf|...
 +
<nowiki>[xyne-x86_64]
 +
# A repo for Xyne's own projects: http://xyne.archlinux.ca/projects/
 +
SigLevel = Required
 +
Server  = http://xyne.archlinux.ca/repos/xyne
 +
</nowiki>}}
 +
 
 +
Make sure that you have replaced ''x86_64'' with ''i686'' or ''any'' depending on your architecture. Then install the package:
 
  # pacman -Sy pacserve
 
  # pacman -Sy pacserve
  
and enable / start the daemon:
+
Finally enable and start the daemon:
 
  # systemctl enable pacserve.service
 
  # systemctl enable pacserve.service
 
  # systemctl start pacserve.service
 
  # systemctl start pacserve.service
  
in case you use iptables, you will probably want this service: pacserve-ports
+
In case you use [[iptables]], you will probably want to start the ''pacserve-ports'' service, too.
  
==Usage==
+
==Standalone usage==
Instead of pacman, use the pacsrv wrapper to perform an update/install packages etc. It will automatically download all packages from the LAN, if someone hosts them with pacserve there. Otherwise it will just download them from the internet mirrors, as usually. For example:
+
Instead of pacman, use the ''pacsrv'' wrapper to perform an update, install packages and so on. It will automatically download all packages from the LAN, if someone hosts them with pacserve there. Otherwise it will just download them from the internet mirrors, as usually. For example:
 
  pacsrv -Syu
 
  pacsrv -Syu
 
  pacsrv -S openssh
 
  pacsrv -S openssh
 +
 +
==Configure Pacman to use Pacserve==
 +
If you are always running the pacserve daemon and want pacman to use it without the wrapper, add the following line below '''each''' repository in /etc/pacman.conf:
 +
  Include = /etc/pacman.d/pacserve
 +
 +
Here's an example for the Xyne repository:
 +
 +
{{hc|/etc/pacman.conf|...
 +
<nowiki>[xyne-x86_64]
 +
SigLevel = Required</nowiki>
 +
'''<nowiki>Include  = /etc/pacman.d/pacserve</nowiki>'''
 +
<nowiki>Server  = http://xyne.archlinux.ca/repos/xyne
 +
...</nowiki>}}
 +
 +
Alternatively (for official mirrors only), you may insert the ''Include...''-line at the top of the Pacman mirrorlist file or let ''pacman.conf-insert_pacserve'' generate a ''pacman.conf'' file for you.
 +
 +
==Troubleshooting==
 +
 +
=== Problems if using external downloaders in pacman.conf ===
 +
 +
If you're using an external downloader such as [[wget]], ''pacsrv'' may return errors when downloading. To work around these errors, simply quote the url and output formatting strings ({{ic|%u}} resp. {{ic|%o}}) using single quotes:
 +
 +
XferCommand = /usr/bin/wget --timeout=6 --passive-ftp -c -O '%o' '%u'

Revision as of 18:55, 13 October 2013

Pacserve allows to easily share pacman packages between computers. This is very useful, if you have a slow internet conenction, but multiple machines running Arch Linux.

Installation

You can either install pacserveAUR manually from the AUR, or with the following method.

From Xyne's repository

Xyne is the author of pacserve, you can directly use his repository by adding the following to your pacman.conf.

/etc/pacman.conf
...
[xyne-x86_64]
# A repo for Xyne's own projects: http://xyne.archlinux.ca/projects/
SigLevel = Required
Server   = http://xyne.archlinux.ca/repos/xyne

Make sure that you have replaced x86_64 with i686 or any depending on your architecture. Then install the package:

# pacman -Sy pacserve

Finally enable and start the daemon:

# systemctl enable pacserve.service
# systemctl start pacserve.service

In case you use iptables, you will probably want to start the pacserve-ports service, too.

Standalone usage

Instead of pacman, use the pacsrv wrapper to perform an update, install packages and so on. It will automatically download all packages from the LAN, if someone hosts them with pacserve there. Otherwise it will just download them from the internet mirrors, as usually. For example:

pacsrv -Syu
pacsrv -S openssh

Configure Pacman to use Pacserve

If you are always running the pacserve daemon and want pacman to use it without the wrapper, add the following line below each repository in /etc/pacman.conf:

 Include = /etc/pacman.d/pacserve

Here's an example for the Xyne repository:

/etc/pacman.conf
...
[xyne-x86_64]
SigLevel = Required
Include  = /etc/pacman.d/pacserve
Server   = http://xyne.archlinux.ca/repos/xyne
...

Alternatively (for official mirrors only), you may insert the Include...-line at the top of the Pacman mirrorlist file or let pacman.conf-insert_pacserve generate a pacman.conf file for you.

Troubleshooting

Problems if using external downloaders in pacman.conf

If you're using an external downloader such as wget, pacsrv may return errors when downloading. To work around these errors, simply quote the url and output formatting strings (%u resp. %o) using single quotes:

XferCommand = /usr/bin/wget --timeout=6 --passive-ftp -c -O '%o' '%u'