Pacman aurutils

From wikinotes

aurutils manages aur packages within your own local pacman repository.
You can then host/share this package repository with other arch systems.

Documentation

github https://github.com/AladW/aurutils
man aur https://github.com/AladW/aurutils/blob/master/man1/aur.1
man aurhosting https://github.com/AladW/aurutils/blob/master/man7/aurhosting.7

Locations

/etc/pacman.d/${your_repo}.conf configure your repo
/etc/pacman.conf you'll need to Include your repo conf

Tutorials

initial setup https://gist.github.com/geosharma/afe1ea9ebe58cb67aaaba62a0d47bc7a

Install

aura -A aurutils

Usage

# add or update package to repo
aur search ${pkg}
aur sync   ${pkg}                 # download, build AUR package to local repo
aur sync -u                       # update all installed AUR packages
aur sync -u --ignore=git-bug-bin  # update all installed AUR packages, ignoring one with an issue
aur sync --rebuild ${pkg}         # force recompile a package (ex. qt5-styleplugins)

# install a package from the repo
sudo pacman -S ${pkg}   # install package from repo

Configuration

Notes

Before getting started, some quick notes

  • You'll be defining a single repo (server/consumer) -- server/client repo_names MUST MATCH
  • The server can install packages from the file:/// repo, you don't need a server and client on the same machine
  • pacman -Syu (all repos) for consumers will fail unless server is online
  • *-dkms packages are fine, and packages are built with their CPU-arch in the name; sharing across cpu types is fine

Server

Create/Use Repo

WARNING:

Obviously, this setup is not ideal for a shared system.
The user that builds packages should not have super-user permissions to install packages on a production system.

# 'build' group members can add packages
mkdir -p /var/cache/pacman/aur
sudo chown ${USER}:${USER} /var/cache/pacman/aur
sudo chmod 775 /var/cache/pacman/aur
# /etc/pacman.d/aur.conf
[options]
CacheDir = /var/cache/pacman/pkg/
CacheDir = /var/cache/pacman/aur/

[aur]
SigLevel = Optional TrustAll
Server = file:///var/cache/pacman/aur
# /etc/pacman.conf

# ...


Include /etc/pacman.d/aur.conf

NOTE:

careful, the user use pass to `-o` must have superuser permissions

sudo install -d -d /var/cache/pacman/aur -o ${USER}
repo-add /var/cache/pacman/aur/aur.db.tar

Adding manually built packages to repo

# copy manually built packages to repo
cp /var/src/*/*.pkg.tar.* /var/cache/pacman/aur/

# add packages to database
repo-add -n aur.db.tar /var/cache/pacman/aur/*.pkg.tar.*

# now update :)
aur sync -u

Host Repo

Any old http server will work

# host repo over HTTP
python -m http.server -d /var/cache/pacman/aur

For example, here's a systemd service to host aur packages

# /etc/systemd/system/aurutils-server.service
#
# vim: ft=systemd

[Unit]
Description=Custom pacman repo to centralize AUR package building.
Requires=network-online.target
After=ctrl-alt-del.target

[Service]
ExecStart=/usr/bin/python -m http.server -d /var/cache/pacman/aur 8000
Type=simple

[Install]
WantedBy=multi-user.target

Clients

Note: like when configuring packages above, the db must match the section-name in pacman.conf (ex. aur.db -> [aur]).

# /etc/pacman.d/aur.conf

[options]
CacheDir = /var/cache/pacman/pkg/
CacheDir = /var/cache/pacman/aur/

[aur]
SigLevel = Optional TrustAll
Server = http://192.168.1.123:8000

Now check for a package you've built on the server

sudo pacman -Syy google-chrome  # tadaa!