Skip to content

Configuration files for caching pacman packages using pacoloco. Supports ALHP and Chaotic-AUR repositories.

Notifications You must be signed in to change notification settings

mnnoee/pacoloco_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Pacoloco Setup: High-Performance Caching for Arch Linux

Optimized configuration for Pacoloco to cache Official, ALHP, and Chaotic-AUR repositories.

English | Русский

Pacoloco: Caching Proxy for Arch Linux

This repository contains my personal configuration for Pacoloco and a brief setup guide.

Why do I need this?

If you have multiple Arch Linux machines at home or in the office, Pacoloco caches packages and distributes them to other devices over the local network. This significantly saves bandwidth and speeds up software installation and updates. For my setup of 6 machines and a mobile internet connection, it’s a lifesaver.

Config Features

  • Prefetch: The server automatically checks for and caches new package versions at 3:00 AM (server time).
  • Support for three repository types:
    • Official Arch Linux repositories (core, extra, multilib).
    • Chaotic-AUR.
    • ALHP (x86-64-v3 and others).

Quick Start

Option 1: Installation via pacman (Bare-metal)

  1. Install Pacoloco:
sudo pacman -S pacoloco
  1. Replace the default config with mine:
sudo cp pacoloco.yaml /etc/pacoloco.yaml
  1. Enable and start the service:
sudo systemctl enable --now pacoloco

Option 2: Running via Docker

  1. Create a Docker container named pacoloco:
docker run -d --name pacoloco \
        -p 9129:9129 \
        -v $(pwd)/pacoloco.yaml:/etc/pacoloco.yaml \
        -v /var/cache/pacoloco:/var/cache/pacoloco \
        --restart unless-stopped \
        ghcr.io/anatol/pacoloco
  1. Replace the default config with mine (if needed inside the volume):
sudo cp pacoloco.yaml /etc/pacoloco.yaml
  1. Restart the container:
sudo docker restart pacoloco

Note Ensure that the /var/cache/pacoloco directory (or whichever you set in the config) exists and is writable.


Client Setup

On every client (other Arch machines), modify the repository sections in /etc/pacman.conf.

Before:

[core-x86-64-v3]
Include = /etc/pacman.d/alhp-mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

[extra-x86-64-v3]
Include = /etc/pacman.d/alhp-mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

[multilib-x86-64-v3]
Include = /etc/pacman.d/alhp-mirrorlist

[multilib]
Include = /etc/pacman.d/mirrorlist

[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist

After:

[core]
Server = http://pacoloco.home.arpa:9129/repo/archlinux/$repo/os/$arch

[extra]
Server = http://pacoloco.home.arpa:9129/repo/archlinux/$repo/os/$arch

[multilib]
Server = http://pacoloco.home.arpa:9129/repo/archlinux/$repo/os/$arch

[core-x86-64-v3]
Server = http://pacoloco.home.arpa:9129/repo/alhp/$repo/os/$arch

[extra-x86-64-v3]
Server = http://pacoloco.home.arpa:9129/repo/alhp/$repo/os/$arch

[multilib-x86-64-v3]
Server = http://pacoloco.home.arpa:9129/repo/alhp/$repo/os/$arch

[chaotic-aur]
Server = http://pacoloco.home.arpa:9129/repo/chaotic-aur/$repo/$arch

Important: Replace pacoloco.home.arpa with your server's actual IP address (e.g., 192.168.1.100) or set up local DNS/mDNS (Avahi) for hostname resolution. Note: If you use x86-64-v4 or x86-64-v2, make sure to replace the architecture string accordingly. Pacoloco will automatically pull the correct repository.


Config Description (pacoloco.yaml)

General Settings

port: 9129
cache_dir: /var/cache/pacoloco
user_agent: Pacoloco/1.7
download_timeout: 3600
  • port: The HTTP port clients use to access the proxy.
  • cache_dir: Directory for package storage. Must be writable by the pacoloco user.
  • user_agent: Mandatory; otherwise, ALHP and some mirrors may reject requests.
  • download_timeout: Max time for downloading a single package (set to 1 hour).

Repositories

archlinux — Official Arch Repos

Mirrors are chosen based on stability and speed: (см. Arch Mirror Status):

urls:
  - http://ftp.halifax.rwth-aachen.de/archlinux
  - https://berlin.mirror.pkgbuild.com
  - https://mirror.yandex.ru/archlinux

chaotic-aur

urls:
  - https://geo-mirror.chaotic.cx  # автоматически редиректит на ближайшее зеркало

alhp

ALHP support for x86-64-v2/v3/v4:

urls:
  - https://mirror.sunred.org/alhp
  - https://alhp.dev
  - https://mirrors.shanghaitech.edu.cn/alhp

All three mirrors are tested and up-to-date. If one is unavailable, Pacoloco will automatically switch to the other.


Prefetch (Auto-downloading)

prefetch:
  cron: "0 0 3 * * *"             # Daily at 3:00 AM
  ttl_unaccessed_in_days: 90      # Keep packages unaccessed for up to 90 days
  ttl_unupdated_in_days: 90       # Keep packages unupdated for up to 90 days

This ensures that "hot" package updates are already cached by the morning.


!! Tips for Users in Russia !!

Some CDNs and foreign mirrors (especially ALHP) may be unavailable due to ISP-level blocking (ТСПУ). (more detailed).

What to do:

  • Use mirrors located in RU/CIS. For the official branch:

    • https://mirror.yandex.ru/archlinux/
    • https://mirror.truenetwork.ru/archlinux/
  • For unofficial branches, check mirrors in:

    • cat /etc/pacman.d/alhp-mirrorlist
    • cat /etc/pacman.d/chaotic-mirrorlist
  • Or configure an HTTP proxy in pacoloco.yaml:

http_proxy: http://your-proxy:port

Bonus: How to check if it's working?

# On the client
sudo pacman -Syu

# On the server — check the logs
journalctl -u pacoloco -f

If you see lines like downloader.go:111: downloading, everything is good to go


Feel free to open an Issue if you have any questions!

About

Configuration files for caching pacman packages using pacoloco. Supports ALHP and Chaotic-AUR repositories.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published