Difference between revisions of "Pacaur"

From ArchWiki
Jump to: navigation, search
(Userbase target: added example)
(removed gpg issue - expac 3 has been released.)
(48 intermediate revisions by 6 users not shown)
Line 8: Line 8:
  
 
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.
 
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.
 +
 +
{{note|Pacaur is targeted at '''advanced users''' who want some degree of automation for repetitive tasks. As such, the user is expected to be familiar with the [[Arch User Repository|manual build process]]. }}
  
 
==Philosophy==
 
==Philosophy==
  
Pacaur main feature revolves around a ''fast workflow'' idea, that is, '''spending as less time as possible interacting with package management prompts'''. The objectives of ''speed'', ''simplicity'' and ''uncluttered interface'' were also taken into consideration.
+
Pacaur's main feature revolves around a ''fast workflow'' idea, that is, '''spending as little time as possible interacting with package management prompts'''. Speed, simplicity and the need for an uncluttered interface were also taken into consideration.
 +
 
 +
Pacaur is:
  
Design concept:
+
Fast
* simply extends pacman to manage the AUR rather than adding lot of features.
+
* It minimizes user interaction.
* ''fast workflow'' to minimize user interaction.
+
* It has very good performance with a small memory footprint.
* usable as a single tool to manage official and AUR packages or as a separate AUR frontend (pacman-like and cower-like interfaces).
+
* It retrieves and edits all PKGBUILDs, solves all conflicts and asks about providers before building anything.
* ready to be run on any system (bash script + C libraries).
+
* built upon existing tools (cower, expac, sudo, pacman-color).
+
  
Main characteristics:
+
Simple
* retrieve and edit all PKGBUILDs before building anything.
+
* It does not add a lot of features, but simply extends pacman to manage the AUR.
* check and solve all conflicts before building anything.
+
* It is a small bash script using existing tiny libraries.
* pass arguments to pacman when appropriate.
+
* It is based on the libalpm C interface directly maintained by a pacman developer.
* search provides regex support (through cower).
+
* show current *and* available version when checking update.
+
* very good performance with minimal memory footprint (C backend).
+
  
Features not implemented "by design":
+
Powerful
* no "interactive" mode.
+
* It can be used as a separate AUR frontend, or a single tool to manage official and AUR packages.
* no customizedpkg support.
+
* It prompts automatically for sudo password.
* no complete dependencies recomputation after you've added/removed some of them. Only binary dependency checking is handled through makepkg.
+
* It searches with regex support (through cower).
* no internationalization.
+
* It shows current and available versions when checking for updates.
 +
* It provides binary and AUR package names completion.
 +
* It detects possible malicious pseudocode in PKGBUILDs, and disposes of an additional full secured mode for paranoid people.
  
 
==Installation==
 
==Installation==
 +
<!-- Please don't add direct commands to install pacaur. All users should be familiar with the build process. -->
  
 
The following binary dependencies need to be installed:
 
The following binary dependencies need to be installed:
Line 40: Line 42:
 
* {{pkg|expac}} [community]
 
* {{pkg|expac}} [community]
  
You can then install {{AUR|cower}} and {{AUR|pacaur}}. The package {{AUR|pacman-color}} is optional but highly recommended for adding color output support.
+
You can then install {{AUR|cower}} as a dependency, and then {{AUR|pacaur}} itself. Both of those packages are available in the [[Arch User Repository|AUR]].
  
==Userbase target==
+
==Usage==
 
+
Pacaur is targeted to advanced users who wants some degree of automation for repetitive tasks and who know what they are doing.
+
 
+
'''Two types of users''' are in mind:
+
* those who prefer to have one single tool to manage AUR and official repositories,
+
* those who prefer to keep their AUR frontend separate from Pacman.
+
 
+
As such there are '''two sets of commands''':
+
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the '''fallback''' variable in the config file.
+
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).
+
 
+
===Example===
+
 
+
pacaur -Ss ''package'' will search the repo, then the AUR if necessary (fallback enabled).
+
 
+
$ pacaur -Ss expac
+
community/expac 1-2
+
    pacman database extraction utility
+
aur/expac-git 20110324-1 (24)
+
    pacman database extraction utility
+
 
+
pacaur -Ss ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR (fallback disabled).
+
 
+
$ pacaur -Ss expac
+
community/expac 1-2
+
    pacman database extraction utility
+
 
+
$ pacaur -Ssa expac
+
aur/expac-git 20110324-1 (24)
+
    pacman database extraction utility
+
 
+
pacaur -s ''package'' will search the AUR only.
+
  
$ pacaur -s expac
 
aur/expac-git 20110324-1 (24)
 
    pacman database extraction utility
 
 
==Usage==
 
 
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.
 
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.
  
Line 102: Line 67:
  
 
options:
 
options:
  pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations"
+
  pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations
   -a, --aur      only search, install or clean packages from the AUR"
+
   -a, --aur      only search, install or clean packages from the AUR
   -r, --repo      only search, install or clean packages from the repositories"
+
   -r, --repo      only search, install or clean packages from the repositories
 
  general
 
  general
 
   -e, --edit      edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags
 
   -e, --edit      edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags
   -c, --clean    clean target(s) build files -- can be combined with the -m, -y, -u flags"
+
   -c, --clean    clean target(s) build files -- can be combined with the -m, -y, -u flags
 
   -q, --quiet    show less information for query and search
 
   -q, --quiet    show less information for query and search
 
   --devel        consider AUR development packages upgrade
 
   --devel        consider AUR development packages upgrade
Line 115: Line 80:
 
   --rebuild      always rebuild package
 
   --rebuild      always rebuild package
 
</pre>
 
</pre>
 +
 +
===Userbase target===
 +
 +
Pacaur has two types of users in mind:
 +
* those who prefer to have one single tool to manage AUR and official repositories,
 +
* those who prefer to keep their AUR frontend separate from Pacman.
 +
 +
As such there are two sets of commands:
 +
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the fallback variable in the config file.
 +
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).
 +
 +
===Example===
 +
 +
By default, pacaur -Ss ''package'' will search the repo, then the AUR if necessary.
 +
 +
$ pacaur -Ss expac
 +
community/expac 1-2
 +
    pacman database extraction utility
 +
aur/expac-git 20110324-1 (24)
 +
    pacman database extraction utility
 +
 +
This behavior is optional and can be disabled with the ''fallback'' variable in the config file. When disabled, pacaur -Ss ''package'' will search the repo only.
 +
 +
Also, pacaur -Ssr ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR.
 +
 +
$ pacaur -Ssr expac
 +
community/expac 1-2
 +
    pacman database extraction utility
 +
 +
$ pacaur -Ssa expac
 +
aur/expac-git 20110324-1 (24)
 +
    pacman database extraction utility
 +
 +
pacaur -s ''package'' will search the AUR only.
 +
 +
$ pacaur -s expac
 +
aur/expac-git 20110324-1 (24)
 +
    pacman database extraction utility
 +
 +
==Configuration==
  
 
Here are the available options in the config file:
 
Here are the available options in the config file:
 
<pre>
 
<pre>
 
#
 
#
# /etc/xdg/pacaur/pacaur.conf
+
# /etc/xdg/pacaur/config
 
#
 
#
  
 
# The following options are commented out with their default values listed.
 
# The following options are commented out with their default values listed.
 
# If you wish to use different values, uncomment and update the values.
 
# If you wish to use different values, uncomment and update the values.
#builddir="${BUILDDIR:-$tmpdir}"       # build directory
+
#builddir="${BUILDDIR:-$tmpdir}"       # build directory
#editor="${EDITOR:-vi}"                 # PKGBUILD editor
+
#editor="${EDITOR:-vi}"               # PKGBUILD editor
#editpkgbuild=true                     # edit PKGBUILD script
+
#editpkgbuild=true                     # edit PKGBUILD script
#editinstall=true                       # edit install script
+
#editinstall=true                     # edit install script
#fallback=true                         # pacman fallback to the AUR
+
#fallback=true                         # pacman fallback to the AUR
#clean=true                             # clean up after package install
+
#clean=true                           # clean up after package install
#cleandevel=true                       # clean up devel package
+
#cleandevel=true                       # clean up devel package
#color=false                           # color support via pacman-color
+
#secure=false                         # enhanced security
 +
#sudoloop=false                        # prevent sudo timeout
 
</pre>
 
</pre>
  
 
See also '''man pacaur'''.
 
See also '''man pacaur'''.
  
==Troubleshooting==
+
=== Config files ===
 +
Pacaur fully honors pacman and makepkg configuration files, as well as the sudoers and cower config file (if existing).
  
===Pacman upgrade===
+
In particular, the following options in {{ic|/etc/pacman.conf}} can be used for further configuration:
When upgrading pacman to a newer version, pacman fails due to dependency conflicts with an older version of cower or pacaur. In pacman.conf, try adding them to the SyncFirst variable:
+
* '''Colors''' to enable colored output.
<pre>
+
* '''VerbosePkgLists''' to display the name, version and size of target packages formatted as a table.
SyncFirst  = pacman cower pacaur
+
</pre>
+
===Using gvim as editor===
+
When using gvim as editor, gvim opens but the build continues. In pacaur.conf, try:
+
  
 +
Note that pacman and makepkg '''environment variables''' ({{ic|$BUILDDIR}}, {{ic|$PKGDEST}}, {{ic|$PACMAN}}, ...) are fully honored.
 +
 +
=== Sudo configuration ===
 +
Pacaur is designed to be used with [[sudo]] for minimal password prompting and your {{ic|/etc/sudoers}} should be configured accordingly.
 +
 +
To avoid password prompt timeout (typically if you went grabbing a coffee while waiting the build to finish), disable it in your sudoers:
 
<pre>
 
<pre>
editor="gvim --nofork"
+
Defaults passwd_timeout=0
 
</pre>
 
</pre>
 +
 +
Alternatively, enable the '''sudoloop''' option in the config file.
 +
 +
==Troubleshooting==
  
 
===Host name error===
 
===Host name error===
 
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.
 
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.
* Try using Google primary DNS (8.8.8.8 and 8.8.4.4), or
+
* [[General_Recommendations#DNS_speed_improvement|Configure your DNS server]] to improve queries speed. Try using Google primary DNS (8.8.8.8 and 8.8.4.4).
* Tweak cower's config file to decrease the number of threads used in "MaxThread" variable.
+
* Alternatively, tweak cower's config file to decrease the number of threads used in "MaxThread" variable.
  
===Password timeout===
+
===Using gvim as editor===
When building a package that takes a long time to compile, sudo times out and pacaur does ask to enter the password again right before installing the package. If this is not done in a default delay of 5 min (typically if you went grabbing a coffee while waiting the build to finish), the password prompt times out and the install fails.
+
When using gvim as editor, gvim opens but the build continues. In the config file, try:
  
Try to disable the password timeout in your sudoers:
 
 
<pre>
 
<pre>
passwd_timeout 0
+
editor="gvim --nofork"
 
</pre>
 
</pre>
  
==External Links==
+
==Improving pacaur==
 +
 
 +
===Internationalization===
 +
See [https://github.com/Spyhawk/pacaur/blob/master/po/HOWTO Internationalization howto].
 +
 
 +
===Bug reports===
 +
When reporting problems, please:
 +
 
 +
* check whether "makepkg -si" can build and install a package successfully. As pacaur relies exclusively on makepkg to build and install packages, the PKGBUILD must be corrected by its maintainer if makepkg fails.
 +
* check that the problem is reproducible, and is not caused by a misconfiguration of pacaur/pacman/makepkg/sudoers/etc.
 +
* post the ouput of "bash -x pacaur <your command>" in the [https://bbs.archlinux.org/viewtopic.php?pid=937423 forum thread] or on [https://github.com/Spyhawk/pacaur github] to help me debug the issue.
 +
 
 +
===Feature requests===
 +
Pacaur is considered as being "feature complete" and will most probably not include any new features. However, any improvement request or patch will be considered, and might be implemented as long as the objectives of speed, simplicity, fast workflow, uncluttered interface and the Arch way are respected.
 +
 
 +
==See also==
 
* [http://spyhawk.github.com/pacaur/ Project page]
 
* [http://spyhawk.github.com/pacaur/ Project page]
 
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]
 
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]
 
* [https://github.com/Spyhawk/pacaur pacaur's github page]
 
* [https://github.com/Spyhawk/pacaur pacaur's github page]

Revision as of 16:51, 16 November 2013

Summary help replacing me
How to install and use pacaur.
Related
AUR Helpers

Pacaur is an Arch User Repository (AUR) helper aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.

Note: Pacaur is targeted at advanced users who want some degree of automation for repetitive tasks. As such, the user is expected to be familiar with the manual build process.

Philosophy

Pacaur's main feature revolves around a fast workflow idea, that is, spending as little time as possible interacting with package management prompts. Speed, simplicity and the need for an uncluttered interface were also taken into consideration.

Pacaur is:

Fast

  • It minimizes user interaction.
  • It has very good performance with a small memory footprint.
  • It retrieves and edits all PKGBUILDs, solves all conflicts and asks about providers before building anything.

Simple

  • It does not add a lot of features, but simply extends pacman to manage the AUR.
  • It is a small bash script using existing tiny libraries.
  • It is based on the libalpm C interface directly maintained by a pacman developer.

Powerful

  • It can be used as a separate AUR frontend, or a single tool to manage official and AUR packages.
  • It prompts automatically for sudo password.
  • It searches with regex support (through cower).
  • It shows current and available versions when checking for updates.
  • It provides binary and AUR package names completion.
  • It detects possible malicious pseudocode in PKGBUILDs, and disposes of an additional full secured mode for paranoid people.

Installation

The following binary dependencies need to be installed:

You can then install cowerAUR as a dependency, and then pacaurAUR itself. Both of those packages are available in the AUR.

Usage

Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.

usage:  pacaur <operation> [options] [package(s)]
operations:
 pacman extension
   -S, -Q          extend pacman operations to the AUR
 AUR only
   -s, --search    search AUR repository for matching strings
   -i, --info      view package information -- pass twice for details
   -d, --download  download target(s) -- pass twice to download AUR dependencies
   -m, --makepkg   download and make target(s)
   -y, --sync      download, make and install target(s)
   -k, --check     check for AUR update(s)
   -u, --update    update AUR package(s)
 general
   -v, --version   display version information
   -h, --help      display help information
   --fixbackend    quickly rebuild backend

options:
 pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations
   -a, --aur       only search, install or clean packages from the AUR
   -r, --repo      only search, install or clean packages from the repositories
 general
   -e, --edit      edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags
   -c, --clean     clean target(s) build files -- can be combined with the -m, -y, -u flags
   -q, --quiet     show less information for query and search
   --devel         consider AUR development packages upgrade
   --ignore        ignore a package upgrade (can be used more than once)
   --noconfirm     do not prompt for any confirmation
   --noedit        do not prompt to edit files
   --rebuild       always rebuild package

Userbase target

Pacaur has two types of users in mind:

  • those who prefer to have one single tool to manage AUR and official repositories,
  • those who prefer to keep their AUR frontend separate from Pacman.

As such there are two sets of commands:

  • commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the fallback variable in the config file.
  • commands that are AUR specific (-s, -i, -m, -y, -k, -u).

Example

By default, pacaur -Ss package will search the repo, then the AUR if necessary.

$ pacaur -Ss expac
community/expac 1-2
    pacman database extraction utility
aur/expac-git 20110324-1 (24)
    pacman database extraction utility

This behavior is optional and can be disabled with the fallback variable in the config file. When disabled, pacaur -Ss package will search the repo only.

Also, pacaur -Ssr package will be restricted to searching in the repo only, while pacaur -Ssa package will search the AUR.

$ pacaur -Ssr expac
community/expac 1-2
    pacman database extraction utility
$ pacaur -Ssa expac
aur/expac-git 20110324-1 (24)
    pacman database extraction utility

pacaur -s package will search the AUR only.

$ pacaur -s expac
aur/expac-git 20110324-1 (24)
    pacman database extraction utility

Configuration

Here are the available options in the config file:

#
# /etc/xdg/pacaur/config
#

# The following options are commented out with their default values listed.
# If you wish to use different values, uncomment and update the values.
#builddir="${BUILDDIR:-$tmpdir}"       # build directory
#editor="${EDITOR:-vi}"                # PKGBUILD editor
#editpkgbuild=true                     # edit PKGBUILD script
#editinstall=true                      # edit install script
#fallback=true                         # pacman fallback to the AUR
#clean=true                            # clean up after package install
#cleandevel=true                       # clean up devel package
#secure=false                          # enhanced security
#sudoloop=false                        # prevent sudo timeout

See also man pacaur.

Config files

Pacaur fully honors pacman and makepkg configuration files, as well as the sudoers and cower config file (if existing).

In particular, the following options in /etc/pacman.conf can be used for further configuration:

  • Colors to enable colored output.
  • VerbosePkgLists to display the name, version and size of target packages formatted as a table.

Note that pacman and makepkg environment variables ($BUILDDIR, $PKGDEST, $PACMAN, ...) are fully honored.

Sudo configuration

Pacaur is designed to be used with sudo for minimal password prompting and your /etc/sudoers should be configured accordingly.

To avoid password prompt timeout (typically if you went grabbing a coffee while waiting the build to finish), disable it in your sudoers:

Defaults passwd_timeout=0

Alternatively, enable the sudoloop option in the config file.

Troubleshooting

Host name error

When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.

  • Configure your DNS server to improve queries speed. Try using Google primary DNS (8.8.8.8 and 8.8.4.4).
  • Alternatively, tweak cower's config file to decrease the number of threads used in "MaxThread" variable.

Using gvim as editor

When using gvim as editor, gvim opens but the build continues. In the config file, try:

editor="gvim --nofork"

Improving pacaur

Internationalization

See Internationalization howto.

Bug reports

When reporting problems, please:

  • check whether "makepkg -si" can build and install a package successfully. As pacaur relies exclusively on makepkg to build and install packages, the PKGBUILD must be corrected by its maintainer if makepkg fails.
  • check that the problem is reproducible, and is not caused by a misconfiguration of pacaur/pacman/makepkg/sudoers/etc.
  • post the ouput of "bash -x pacaur <your command>" in the forum thread or on github to help me debug the issue.

Feature requests

Pacaur is considered as being "feature complete" and will most probably not include any new features. However, any improvement request or patch will be considered, and might be implemented as long as the objectives of speed, simplicity, fast workflow, uncluttered interface and the Arch way are respected.

See also