Pacman aurutils: Difference between revisions

From wikinotes
 
(9 intermediate revisions by the same user not shown)
Line 19: Line 19:
{| class="wikitable"
{| class="wikitable"
|-
|-
| <code>/etc/pacman.conf</code> || include your repo in pacman's conf
| <code>/etc/pacman.d/${your_repo}.conf</code> || configure your repo
|-
|-
| <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
|-
|-
|}
|}
Line 47: Line 47:
# add or update package to repo
# add or update package to repo
aur search ${pkg}
aur search ${pkg}
aur sync  ${pkg}       # download, build AUR package to local repo
aur sync  ${pkg}                 # download, build AUR package to local repo
aur sync -u             # update all installed AUR packages
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
Line 57: Line 59:
= Configuration =
= Configuration =
<blockquote>
<blockquote>
== Create/Use Repo ==
== Notes ==
<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>
<blockquote>
{{ WARNING |
{{ WARNING |
Line 87: Line 100:
# ...
# ...


Include /etc/pacman.d/aurutils.conf
 
Include /etc/pacman.d/aur.conf
</syntaxhighlight>
</syntaxhighlight>


Line 98: Line 112:
repo-add /var/cache/pacman/aur/aur.db.tar
repo-add /var/cache/pacman/aur/aur.db.tar
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- pacman.conf -->
</blockquote><!-- Create/Use Repo -->


== Adding manually built packages to repo ==
=== Adding manually built packages to repo ===
<blockquote>
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 114: Line 128:
</blockquote><!-- Adding manually built packages to repo -->
</blockquote><!-- Adding manually built packages to repo -->


== Host Repo ==
=== Host Repo ===
<blockquote>
You've already created a git repo, you just need to host it now.
 
=== Server ===
<blockquote>
<blockquote>
Any old http server will work
Any old http server will work
Line 144: Line 154:
WantedBy=multi-user.target
WantedBy=multi-user.target
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Host Repo -->
</blockquote><!-- Server -->
</blockquote><!-- Server -->


=== Clients ===
== Clients ==
<blockquote>
<blockquote>
Note: like when configuring packages above, the db must match the section-name in pacman.conf (ex. aur.db -> [aur]).
Note: like when configuring packages above, the db must match the section-name in pacman.conf (ex. aur.db -> [aur]).
Line 167: Line 178:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Clients -->
</blockquote><!-- Clients -->
</blockquote><!-- Host Repo -->
</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 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!