Arch Linux Yaourt AUR套件管理

Arch Linux Yaourt AUR套件管理

Arch与其他Linux分支不同, 它支援使用者将他们喜爱的套件在社群上分享,它称作Arch User Repository 简称AUR但它不支持pacman安装,必需手动进行下载、安装、检查,因如此通常被认为进阶者才会想要去尝试的,但Yaourt的出现简化许多的过程。

Yaourt(Yet AnOther User Repository Tool)是基于pacman的外壳(前导程式),它外加了AUR的支持,帮助使用者从AUR上下载软件的相关讯息的PKGBUILD再经过makepkg产生安装套件的准备工作,最后利用pacman完成安装,省下许多步骤。

Yaourt安装利用客制套件的方式安装并非使用源始码安装,加入archlinuxcn客制套件来源,它不止将Yaourt编译成套件,还有其他许多的来源也编成套件,建议第一次使用Arch能加入此客制套件来源

设定套件来源

开启/etc/pacman.conf

sudo nano /etc/pacman.conf

并加入:

[archlinuxcn]
SigLevel = Never
Server = http://repo.archlinuxcn.org/$arch

如果你安装的是64bit版本的Arch, 在加入完成后将以下内容的注解(#)取消:

[multilib]
Include = /etc/pacman.d/mirrorlist

替64bit环境加入支援32bit函式库的套件来源,当程式需要32bit环境时可以加装32bit函式库就能支援。

安装base-devel

未来一些经过AUR伺服器下载回来的可能是原始码要进行直接编译成可执行程式时就需要base-devel 群组套件,它是经过官方所整理出来的套件群组(Group)先来看看内容有包含什么:

群组套件的好处是一次就将相关的套件都安装完成,你的环境需要有开发环境时安装此群组套件,其他群组套件参照官方网站 Group Details,现在进行安装:

pacman -Sy --needed base-devel

注:参数y找最新的套件安装;--needed需要时再重新安装

安装Yaourt

经过上述的修改与新增设定后就能透过pacman安装Yaourt

pacman -S yaourt

耐心等待一段时间后就能将Yaourt安装完成,此时执行帮助了解它的参数:

yaourt -h

$ yaourt -h
Usage: yaourt <operation> [...]
operations:
    yaourt (search pattern|package file)
    yaourt {-h --help}
    yaourt {-V --version}
    yaourt {-Q --query}       [options] [package(s)]
    yaourt {-R --remove}      [options] <package(s)>
    yaourt {-S --sync}        [options] [package(s)]
    yaourt {-U --upgrade}     [options] <package(s)>
    yaourt {-C --clean}       [options]
    yaourt {-B --backup}      [save directory|restore file]
    yaourt {-G --getpkgbuild} [options] <package(s)>
    yaourt {--stats}
$

其中有options参数不在帮助说明中,必需要使用man了解细节:

man yaourt

YAOURT(8)                                                                                                     Yaourt Manual                                                                                                    YAOURT(8)

NAME
       yaourt - more than a frontend to pacman

SYNOPSIS
       yaourt <operation> [options] [packages]

       yaourt (search pattern|package file)

DESCRIPTION
       Yaourt is a pacman frontend with a lot of features.

       AUR/ABS support, colorized output, interactive search/install, save/restore Alpm database, orphans detection, manage .pac* files, ...

OPERATIONS
       Since the majority of those options are the same as pacman’s (pacman(8)), this manual page will focus on the yaourt-specific ones.

       -B, --backup
           Backup or restore alpm local database. See Backup Options.

       -C
           Manage .pac* files. See Clean Options.

       -G, --getpkgbuild <package>
           Get PKGBUILD for ABS or AUR.

       -Q, --query
           Query local database + Can sort packages by installation date, possibility to delete orphans. See Query Options.

       -R, --remove
           Remove package(s) from the system.

       -U, --upgrade
           Upgrade or add package(s) to the system.

       -S, --sync
           Synchronize packages + AUR support, building from sources. See Sync Options.

       --stats
           Show some statistics about your packages.

       -V, --version
           Display version and exit.

       -h, --help
           Display a short help.

OPTIONS
       --color
           Force color.

       --export <dir>
           Export built packages and their sources (makepkg(8)) to <dir>.

       --force
           Force installation or updates.

       --insecure
           Allow curl & package-query to perform "insecure" SSL connections

       --nocolor
           Disable color.

       --noconfirm
       --pager
           Use $PAGER to show search results.

       --tmp <dir>
           Use <dir> as temporary folder. default to /tmp

BACKUP OPTIONS
       yaourt -B
           Backup alpm local database in current dir.

       yaourt -B <dir>
           Backup alpm local database in <dir>/pacman-date.tar.bz2

       yaourt -B <file>
           Restore alpm local database from <file>.

CLEAN OPTIONS
       Manage .pacnew, .pacsave and .pacorig files.

       -c, --clean
           Clean all these files.

QUERY OPTIONS
       --backupfile <file>
           Query <file> instead of alpm/aur.

       --date
           List queries result sorted by installation date.

       -d, --deps
           Filter output to packages installed as dependencies.

       -t, --unrequired
           Filter output to packages not required by any currently installed package. With -d, yaourt list all real orphans and ask for deletion.

SYNC OPTIONS
       -a, --aur
           Also search in AUR database. With -u or --sysupgrade, upgrade aur packages that are out of date. With -Qm, display more info about foreign package.

       -A, --ignorearch
           Pass -A or --ignorearch option to makepkg(8) to ignore PKGBUILD(5) arch field.

       --aur-url <AUR url>
           Specify a custom AUR url (default to https://aur.archlinux.org).

       --conflicts
           Show packages that conflicts with one of the targets.

       -b, --build
           Build from sources, ABS for official packages, or AUR if packages is not found. Specify this option twice to build all dependencies.

       --depends
           Show packages that depends on one of the targets.

       --devel
           With -u or --sysupgrade, search an update for devel packages.

       -i, --info
           Display dependency and other information for a given package. This will search through all repositories and AUR database for a matching package.

       --m-arg <opts>
           Pass additional options to makepkg(8). To pass more than one option, put them in quotes.

       --provides
           Show packages that provides one of the targets.

       --replaces
           Show packages that replaces one of the targets.

       -u, --sysupgrade
           Upgrade all packages that are out of date.

HANDLING CONFIG FILES
       With AUTOSAVEBACKUPFILE (yaourtrc(5)), yaourt will search and save all files marked as backup. These files can be used later with yaourt -C to automerge current configuration files with new ones.

CONFIGURATION
       See yaourtrc(5) for more details on configuring yaourt using the yaourtrc file.

ENVIRONMENT VARIABLES
       MAKEPKG
           Set an alternative makepkg(8) command.

       PACMAN
           Set an alternative pacman(8) command.

       TMPDIR
           Set a temporary folder to use.

       YAOURT_COLORS
           Set a user defined colors. (see package-query(8))

SEE ALSO
       yaourtrc(5), makepkg(8), pacman(8)

       See the yaourt website at http://archlinux.fr/yaourt-en/ for more info.

BUGS
       https://github.com/archlinuxfr/yaourt

AUTHORS
       Julien MISCHKOWITZ <wain@archlinux.fr>

       Current maintainers:

       Tuxce <tuxce.net@gmail.com>

       Skunnyk <skunnyk@archlinux.fr>

Yaourt 1.6                                                                                     

安装AUR套件

丹尼经常 使用的haroopad也有Linux版本,不过上官网它只提供rpmdeb的安装方式,利用指令查询结后已经有网友提供AUR套件 :

yaourt -Ss haroopad

查询结果:

$ yaourt -Ss haroopad
aur/haroopad 0.13.1-4
    A markdown enabled document processor
$

yaourt必需在非root帐号上执行,过程中会需要输入sudo密码:

yaourt -S haroopad

自动下载相关档案并进行编译

安装过程一样需要一段时间,等待安装完成后就能看到应用程式:

参考资料

更新日志

日期 内容
2017/06/11 更新内容,调整标
2016/01/06 初版

关键字

  • archlinux arch linux
  • yaourt aur install
  • Arch Linux安装Yaourt非官方套件管理员