1 .TH AUR 1 2023-02-03 AURUTILS
3 aur \- helper tool for the arch user repository
7 is the command wrapper for
9 a collection of scripts to automate usage of the Arch User
10 Repository. Different tasks such as update checks, package searching,
11 and computing dependencies are split to separate commands.
13 The chosen approach for managing packages is local pacman
14 repositories, instead of foreign (installed by
18 A brief overview of local repositories is given in the
19 .B "CREATING A LOCAL REPOSITORY"
23 The below gives a short overview; see the respective documentation for
27 searches for commands in
28 .BR /usr/lib/aurutils/
29 by default, followed by
31 as set in the environment. A different path may be set at run-time
34 environment variable, for example
35 .IR /usr/local/lib/aurutils:/usr/lib/aurutils .
40 Build packages to a local repository.
46 Build pacman packages with systemd-nspawn.
52 Retrieve dependencies using aurweb.
58 Fetch packages from a location.
64 Format AurJson output to text strings.
70 Print package/dependency directed graph.
76 Print the AUR package list.
82 Send GET requests to the aurweb RPC interface.
88 Manage local repositories.
92 .BR aur\-repo\-filter (1)
94 Filter packages in the Arch Linux repositories.
100 Search for AUR packages.
106 List version of VCS packages.
112 Download and build AUR packages automatically.
118 Check packages for AUR updates.
129 .SH CREATING A LOCAL REPOSITORY
130 A local repository may be configured directly in
131 .BR /etc/pacman.conf ,
132 or in a separate file specified with the
134 directive. This section documents an example configuration; for
141 Avoid naming the repository
143 as this name is reserved by
148 Consider separate repositories for different purposes, such as
149 version control packages.
151 .SS Pacman configuration
152 For the purposes of this example, we assume the local repository
155 .IR /home/custompkgs .
157 Append a section for the local repository to
162 SigLevel = Optional TrustAll
163 Server = file:///home/custompkgs
166 Create the repository root and database:
169 $ sudo install \-d /home/custompkgs \-o $USER
170 $ repo\-add /home/custompkgs/custom.db.tar.gz
173 If built packages are available, add them to the database:
176 $ cd /home/custompkgs
177 $ repo\-add \-n custom.db.tar.gz *.pkg.tar*
186 .SS CacheDir (optional)
187 When packages from a local repository are installed through
189 they are copied to a cache directory (usually
190 .IR /var/cache/pacman/pkg )
193 Besides using additional space, this may result in checksum mismatches
194 when rebuilding packages without increasing
196 (See GitHub issue #85)
198 To avoid this, set the repository path as a
202 .B "CleanMethod = KeepCurrent"
203 setting to avoid unexpected deletion of built packages with
206 This can be done by editing
212 CacheDir = /var/cache/pacman/pkg /home/custompkgs
213 CleanMethod = KeepCurrent
222 if package signing is disabled or enabled, respectively. This avoids
224 copying over packages to the main
226 if signature files are missing and
227 .B SigLevel = Optional
232 will remove packages regardless of the
237 In this section, we assume that
239 is the interactive shell.
241 .SS Arch User Repository
242 Run actions on the dependency tree of an AUR package:
245 $ aur depends \-r foo \-n | tsort | while read \-r pkg; do ... done
248 Retrieve AUR pkgbases and their dependencies recursively:
251 $ aur depends \-r foo | tsort | aur fetch \-
254 Retrieve all AUR packages from a given maintainer:
257 $ aur search \-m mcaur \-\-json | aur format \-f \(aq%b\\n\(aq | aur fetch \-
261 .I plasma\-desktop\-git
262 and its dependencies with
263 .BR systemd\-nspawn (1):
266 $ aur sync \-c plasma\-desktop\-git
269 Update all AUR packages in a single local repository:
275 Check foreign packages for AUR updates:
278 $ pacman \-Qm | aur vercmp
283 repository for AUR updates:
286 $ aur repo \-d custom \-\-list | aur vercmp
291 only contains one local repository, the above may be shortened to:
294 $ aur repo \-\-upgrades
297 .SS Arch User Repository - advanced usage
298 Print packages from the
300 repository that are unavailable in the AUR:
303 $ grep \-Fxvf <(aur pkglist) <(pacman \-Slq custom)
306 As above, but for orphaned packages:
309 $ pacman \-Slq custom | aur query \-t info \- | \e
310 jq \-r \(aq.results[] | select(.Maintainer == null)\(aq
313 Update packages in the
315 repository which are installed on the host:
318 $ grep \-Fxf <(pacman \-Qq) <(pacman \-Slq custom) > installed.txt
319 $ xargs \-a installed.txt aur sync \-d custom
322 Search for AUR packages with both
329 $ aur pkglist \-P \(aq(?=.*wm)(?=.*git)\(aq | aur search \-i \-
332 Select an AUR package with name matching
334 and build the result:
337 $ select a in $(aur pkglist \-F pony); do aur sync "$a"; break; done
340 .SS Official repositories
341 Print Perl modules that are both in the AUR and official repositories:
344 $ aur pkglist \-P \(aq^perl\-.+\(aq > perl.txt
345 $ grep \-Fxf <(aur repo\-filter < perl.txt) perl.txt
348 Print packages both in AUR and
350 and compare their versions:
353 $ aur repo \-d community \-\-all
357 Build packages in the
359 github repository (generating required
364 $ git clone https://www.github.com/Earnestly/pkgbuilds
366 $ find \-name PKGBUILD \-execdir sh \-c \(aqmakepkg \-\-printsrcinfo > .SRCINFO\(aq \e;
367 $ aur graph */.SRCINFO | tsort | tac > queue # Remove unwanted targets
368 $ aur build \-a queue
371 Build a package for a different architecture, here \fIi686\fR:
374 $ setarch i686 aur sync \-c \-\-repo=custom_i686 tclkit
379 The following scripts are examples of custom commands added anywhere
380 in $PATH, for example
387 # Remove unused build files in aur\-sync cache
388 XDG_CACHE_HOME=${XDG_CACHE_HOME:\-$HOME/.cache}
389 AURDEST=${AURDEST:\-$XDG_CACHE_HOME/aurutils/sync}
391 # Assumes build files were retrieved through git(1)
392 find "$AURDEST" \-name .git \-execdir git clean \-xdf \e;
394 # Print directories which do not contain a PKGBUILD file
395 for d in "$AURDEST"/*; do
396 if [[ \-d $d ]] && [[ ! \-f $d/PKGBUILD ]]; then
397 printf \(aq%s\en\(aq "$d"
407 # aur\-remove \- remove listed packages from all local repositories
409 if [ "$#" \-eq 0 ]; then
410 printf \(aqusage: aur remove package [package ...]\en\(aq >&2
414 aur repo \-\-list\-path | while read \-r repo_path; do
415 repo\-remove "$repo_path" "$@"
416 paccache \-c "${repo_path%/*}" \-rvk0 "$@"
420 .SS Using third-party helpers
421 Repository packages can be "made foreign" by temporarily removing the
422 repository from the pacman configuration. This can be used with programs
425 environment variable and check foreign packages for AUR updates.
427 For example, create the
430 .IR /usr/local/bin/mypacman :
434 pacman \-\-config=/usr/share/devtools/pacman\-extra.conf "$@"
442 $ export PACMAN=/usr/local/bin/mypacman
446 Environment variables for
448 programs are prefixed with
450 Where applicable, standard variables such as
452 are respected. Variables supported by specific programs are listed
453 in their respective man pages (see
454 .BR "AUR COMMANDS" ).
456 Variables can be set in the user environment or in
457 .IR $XDG_CONFIG_HOME/aurutils/env ,
458 using a key/value format separated by newlines. For example:
462 AURDEST=/home/custompkgs
463 AUR_PACMAN_AUTH=sudo --askpass
471 Setting this variable enables debug mode (typically
483 searches for commands, prepended to
486 .BR /usr/lib/aurutils .
490 Output colorization can be disabled by setting this environment
494 Programs follow a subset of
496 or preserve command status where
500 .MT https://github.com/AladW
504 .\" vim: set textwidth=72