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非官方套件管理員