Difference between revisions of "Yaourt"

From ArchWiki
Jump to navigation Jump to search
(→‎Troubleshooting: one item is directly related to the other, and the first workaround is far better (define a sane builddir) than the second (changing tmpfs). Remove second section, reword first)
(Ok, I've given a more accurate title)
Line 131: Line 131:
 
to {{ic|/etc/yaourtrc}} or to {{ic|~/.yaourtrc}}
 
to {{ic|/etc/yaourtrc}} or to {{ic|~/.yaourtrc}}
  
=== tmpfs ===
+
=== Yaourt freezing up or unable to continue due to no space left on device ===
  
 
Yaourt uses {{ic|/tmp}} (mounted as [[tmpfs]], limited to 50% of RAM) to compile packages, which may be problematic for systems with low RAM or limited swap space. Change the location in {{ic|/etc/yaourtrc}} by uncommenting and changing the {{ic|TMPDIR}} variable.
 
Yaourt uses {{ic|/tmp}} (mounted as [[tmpfs]], limited to 50% of RAM) to compile packages, which may be problematic for systems with low RAM or limited swap space. Change the location in {{ic|/etc/yaourtrc}} by uncommenting and changing the {{ic|TMPDIR}} variable.

Revision as of 01:26, 25 February 2015

zh-CN:Yaourt zh-TW:Yaourt

Warning: Yaourt is an unofficial, third-party script that is not supported by the Arch Linux developers.
Note: Please report bugs at the archlinux.fr bugtracker.

Yaourt (Yet AnOther User Repository Tool; French for 'Yogurt') is a community-contributed wrapper for pacman which adds seamless access to the AUR, allowing and automating package compilation and installation from your choice of the thousands of PKGBUILDs in the AUR, in addition to the many thousands of available Arch Linux binary packages. Yaourt uses the same exact syntax as pacman, which saves you from relearning an entirely new method of system maintenance but also adds new options. Yaourt expands the power and simplicity of pacman by adding even more useful features and provides pleasing, colorized output, interactive search mode, and much more.

Installation

First you need to install package-queryAUR as a dependency, and then the yaourtAUR package itself. Since both those packages are available from the AUR, you will have to install them with the official method for installing unsupported packages, which is exhaustively described in the AUR article. It is important that you understand what "unsupported package" really means, and you can take this as an opportunity to learn what are the operations that AUR helpers like yaourt make automatic. You might want to have the base-devel group installed as well, since some packages require the GNU autotools.

Alternatively, add the (unsigned) archlinuxfr repository as described on the yaourt homepage.

Proxy settings

If you access the Internet through an HTTP proxy, you may have to set the environment variables http_proxy and https_proxy in your ~/.bashrc (setting only http_proxy will prevent you from downloading the package from AUR):

$ export http_proxy='http://proxy.hostname.com:port'
$ export https_proxy='https://proxy.hostname.com:port'

For more information, check curl's man page.

sudo does not keep environment variables like http_proxy, so if you use sudo, you must use visudo command to edit /etc/sudoers and add:

Defaults env_keep += "http_proxy"
Defaults env_keep += "https_proxy"
Defaults env_keep += "ftp_proxy"

Using yaourt

You can install packages (including AUR packages) with

$ yaourt packagename

or

$ yaourt -Sa packagename

You can update your system including AUR packages with:

$ yaourt -Syua

See the yaourt manual page for more information.

Examples

Search and install:

$ yaourt search pattern

Sync database, upgrade packages, search the AUR and devel (all packages based on cvs, svn, git, bzr(...)-version) upgrades:

$ yaourt -Syua --devel

Build package from source:

$ yaourt -Sb package

Check, edit, merge or remove *.pac* files:

$ yaourt -C

Get a PKGBUILD (support split package):

$ yaourt -G package

Build and export package, its sources to a directory:

$ yaourt -Sb --export dir package

Backup database:

$ yaourt -B

Query backup file:

$ yaourt -Q --backupfile file

See also: Pacman and Pacman tips.

Persistent local source repositories

By default, yaourt will pull remote repositories for building to /tmp. To avoid having to refetch whole repositories whenever AUR packages update, you can change this directory by uncommenting and setting DEVELSRCDIR in yaourtrc to wherever you want source repositories pulled to. Note this will only apply to devel packages, usually suffixed by -git or -svn.

/etc/yaourtrc
DEVELSRCDIR="/var/abs/local/yaourtbuild"

Cache

Yaourt by default does not save built package tarballs during installation. To save built AUR packages in the default pacman folder /var/cache/pacman/pkg, edit /etc/yaourtrc and set:

# Build
EXPORT=2

Alternatively, set up a separate folder for Yaourt packages by changing these lines to:

# Build
EXPORT=1
EXPORTDIR="/var/cache/pacman/pkg-local"

Troubleshooting

Yaourt asking for password twice

If you disable the sudo password timeout by adding

Defaults timestamp_timeout=0

to /etc/sudoers, then yaourt will ask for your password twice each time you try to perform an operation that requires root. To prevent this, add:

SUDONOVERIF=1

to /etc/yaourtrc or to ~/.yaourtrc

Yaourt freezing up or unable to continue due to no space left on device

Yaourt uses /tmp (mounted as tmpfs, limited to 50% of RAM) to compile packages, which may be problematic for systems with low RAM or limited swap space. Change the location in /etc/yaourtrc by uncommenting and changing the TMPDIR variable.

Yaourt installing unwanted subpackages (split PKGBUILD)

Refer to issue #50 upstream, during the install/upgrade cycle yaourt is passing pacman the directory where the packages were built and not the direct name of only one package. This causes any package (i.e. subpackages automatically built) in that directory to get added to the install list and not just the named package; as a workaround use --pkg like so:

yaourt --pkg foo -S foo

This will prevent subpackages (foo-bar, foo-baz, etc.) from being built or installed if they're not required dependencies. During a full system upgrade (-Syua) the problem still exists; instead upgrade those AUR packages manually first on their own until it's worked out upstream.

Tricks

Git package shallow clone

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: PKGFILE ??? (Discuss in Talk:Yaourt#)

Sadly PKGFILE doesn't support git shallow clone, and we end up cloning everything in the repository, which become bearable while cloning the big repositories like emacs, firefox, inkscape etc..

Which can be worked around doing manual git clone.

1. set the DEVELSRCDIR="/path/to/directory/" and DEVEL=0 in yaourtrc, see man yaourtrc

2. use yaourt to download PKGFILE and copy the source by selecting edit PKGFILE

3. let yaourt build the package, and terminate it so that, folder structure is created

4. go to the DEVELSRCDIR, package name then

$ git clone --depth=1 --bare <git-repository>

5. run the yaourt again.