Difference between revisions of "Pacserve"

From ArchWiki
Jump to: navigation, search
(add Configuration)
m (style)
Line 26: Line 26:
 
  # pacsrv -S openssh
 
  # pacsrv -S openssh
  
==Configure Pacman to use Pacserve==
+
== Configure Pacman to use Pacserve ==
If you are always running the pacserve daemon and want pacman to use it without the wrapper, insert the following line (before any other {{ic|Include}} lines) in '''each''' repository in /etc/pacman.conf.
+
 
 +
If you are always running the pacserve daemon and want pacman to use it without the wrapper, insert the following line (before any other {{ic|Include}} lines) in '''each''' repository in {{ic|/etc/pacman.conf}}.
 +
 
 
   Include = /etc/pacman.d/pacserve
 
   Include = /etc/pacman.d/pacserve
  
 
Here is an example for the Xyne repository:
 
Here is an example for the Xyne repository:
  
{{hc|/etc/pacman.conf|...
+
{{hc|/etc/pacman.conf|2=
<nowiki>[xyne-x86_64]
+
...
SigLevel = Required</nowiki>
+
[xyne-x86_64]
'''<nowiki>Include  = /etc/pacman.d/pacserve</nowiki>'''
+
SigLevel = Required
<nowiki>Server  = http://xyne.archlinux.ca/repos/xyne
+
'''Include  = /etc/pacman.d/pacserve'''
...</nowiki>}}
+
Server  = <nowiki>http://xyne.archlinux.ca/repos/xyne</nowiki>
 +
...
 +
}}
  
Alternatively (for official mirrors only), you may insert the {{ic|Include}} line at the top of the Pacman mirrorlist file or let ''pacman.conf-insert_pacserve'' generate a ''pacman.conf'' file for you.
+
Alternatively (for official mirrors only), you may insert the {{ic|Include}} line at the top of the Pacman mirrorlist file or let ''pacman.conf-insert_pacserve'' generate a {{ic|pacman.conf}} file for you.
  
==Troubleshooting==
+
== Troubleshooting ==
  
 
=== Problems if using external downloaders in pacman.conf ===
 
=== Problems if using external downloaders in pacman.conf ===

Revision as of 16:26, 23 July 2018

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

Installation

You can either install pacserveAUR.

Tip: The package is also available in the xyne-x86_64 unofficial repository.

Finally start/enable pacserve.service.

In case you use iptables, you will probably want to start pacserve-ports.service too. For other firewalls open TCP and UDP ports 15678. The UDP port can be limited to multicast traffic only.

Configuration

The pacserve.service can configured by editing PACSERVE_ARGS in /etc/pacserve/pacserve.service.conf. Run pacserve --help to see the available options.

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, insert the following line (before any other Include lines) in each repository in /etc/pacman.conf.

 Include = /etc/pacman.d/pacserve

Here is 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 are 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'