Pacman aurutils: Difference between revisions
From wikinotes
(→Usage) |
(→Usage) |
||
(25 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
|} | |} | ||
</blockquote><!-- Documentation --> | </blockquote><!-- Documentation --> | ||
= Locations = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| <code>/etc/pacman.d/${your_repo}.conf</code> || configure your repo | |||
|- | |||
| <code>/etc/pacman.conf</code> || you'll need to <code>Include</code> your repo conf | |||
|- | |||
|} | |||
</blockquote><!-- Locations --> | |||
= Tutorials = | = Tutorials = | ||
Line 36: | Line 47: | ||
# add or update package to repo | # add or update package to repo | ||
aur search ${pkg} | aur search ${pkg} | ||
aur sync ${pkg} | aur sync ${pkg} # download, build AUR package to local repo | ||
aur sync -u | 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 | # install a package from the repo | ||
pacman -S ${pkg} # install package from repo | sudo pacman -S ${pkg} # install package from repo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Usage --> | </blockquote><!-- Usage --> | ||
Line 46: | Line 59: | ||
= Configuration = | = Configuration = | ||
<blockquote> | <blockquote> | ||
== | == Notes == | ||
<blockquote> | <blockquote> | ||
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 <code>file:///</code> repo, you don't need a server and client on the same machine | |||
* <code>pacman -Syu</code> (all repos) for consumers will fail unless server is online | |||
* <code>*-dkms</code> packages are fine, and packages are built with their CPU-arch in the name; sharing across cpu types is fine | |||
</blockquote><!-- Notes --> | |||
== Server == | |||
<blockquote> | |||
=== Create/Use Repo === | |||
<blockquote> | |||
{{ WARNING | | |||
Obviously, this setup is not ideal for a shared system.<br> | |||
The user that builds packages should not have super-user permissions to install packages on a production system.<br> | |||
}} | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# 'build' group members can add packages | # 'build' group members can add packages | ||
mkdir -p /var/cache/pacman/aur | mkdir -p /var/cache/pacman/aur | ||
sudo chown | sudo chown ${USER}:${USER} /var/cache/pacman/aur | ||
sudo chmod 775 /var/cache/pacman/aur | sudo chmod 775 /var/cache/pacman/aur | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="dosini"> | <syntaxhighlight lang="dosini"> | ||
# /etc/pacman.d/ | # /etc/pacman.d/aur.conf | ||
[options] | [options] | ||
CacheDir = /var/cache/pacman/pkg/ | CacheDir = /var/cache/pacman/pkg/ | ||
Line 71: | Line 100: | ||
# ... | # ... | ||
Include /etc/pacman.d/ | |||
Include /etc/pacman.d/aur.conf | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 79: | Line 109: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo install -d -d /var/cache/pacman/aur -o | sudo install -d -d /var/cache/pacman/aur -o ${USER} | ||
repo-add /var/cache/pacman/aur/aur.db.tar | repo-add /var/cache/pacman/aur/aur.db.tar | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- pacman. | </blockquote><!-- Create/Use Repo --> | ||
=== Adding manually built packages to repo === | |||
<blockquote> | |||
<syntaxhighlight lang="bash"> | |||
# 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 | |||
</syntaxhighlight> | |||
</blockquote><!-- Adding manually built packages to repo --> | |||
== Host Repo == | === Host Repo === | ||
<blockquote> | <blockquote> | ||
Any old http server will work | |||
<syntaxhighlight lang="bash"> | |||
# host repo over HTTP | |||
python -m http.server -d /var/cache/pacman/aur | |||
</syntaxhighlight> | |||
For example, here's a systemd service to host aur packages | |||
<syntaxhighlight lang="dosini"> | |||
# /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 | |||
</syntaxhighlight> | |||
</blockquote><!-- Host Repo --> | </blockquote><!-- Host Repo --> | ||
</blockquote><!-- Server --> | |||
== Clients == | |||
<blockquote> | |||
Note: like when configuring packages above, the db must match the section-name in pacman.conf (ex. aur.db -> [aur]). | |||
<syntaxhighlight lang="dosini"> | |||
# /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 | |||
</syntaxhighlight> | |||
Now check for a package you've built on the server | |||
<syntaxhighlight lang="bash"> | |||
sudo pacman -Syy google-chrome # tadaa! | |||
</syntaxhighlight> | |||
</blockquote><!-- Clients --> | |||
</blockquote><!-- Configuration --> | </blockquote><!-- Configuration --> |
Latest revision as of 18:58, 17 December 2023
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 machinepacman -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 fineServer
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.confNOTE:
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.tarAdding 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 -uHost Repo
Any old http server will work
# host repo over HTTP python -m http.server -d /var/cache/pacman/aurFor 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.targetClients
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:8000Now check for a package you've built on the server
sudo pacman -Syy google-chrome # tadaa!