Using Arch Linux’s pacman/ABS/AUR

  • pacman combines a simple binary package format with an easy-to-use build system. Written in the C programming language and uses the .pkg.tar.xz package format.
# update package databases
$ pacman -Sy

# search all package, or just installed
$ pacman -Ss <package> or pacman -Qs <package>
(add color, either use 'pacsearch <package>' a perl wrapper for 'pacman -Ss' or)
$ nano /etc/pacman.conf

# query all package info, or just installed package info
$ pacman -Si <package> or pacman -Qi <package>
# lists all files associated with a package
$ pacman -Ql <package>
# list package disk usage
$ pacsysclean

# download/install
$ sudo pacman -S <package>
# just download
$ sudo pacman -Sw <package>
# install locally, used in AUR
$ sudo pacman -U <package_path>

# list packages out of date
$ pacman -Qu
# install packages out of date
$ sudo pacman -Syu

# list downloaded packages
$ ls /var/cache/pacman/pkg | grep <package>
# revert to a package in your cache
$ pacman -U <path_to_cached_file>
# rollback using
$ pacman -U
# same using downgrade/downgrader
$ downgrade <package> | downgrader <package>

# remove a package, leaves dependencies
$ sudo pacman -R <package>
# remove packages and orphan dependencies
$ sudo pacman -Rs <package>

# mirrors by speed, see
$ sudo cp /etc/pacman.d/mirrorlist{,.backup}
$ sudo rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
$ sudo pacman -Syy

# pacman frontends,
# note: if using putty change translation to latin1
$ sudo pacman -S pcurses 
$ yaourt yaourt-gui

# tips, see and
# remove orphan packages
$ pacman -Rns $(pacman -Qtdq)
# reinstall all packages (except foreign)
# pacman -Qenq | pacman -S -
# remove all the cached packages not installed
$ sudo pacman -Sc

from howto use arch package management

While pacman is the specialized Arch tool for binary package management (including packages built with the ABS), ABS is a collection of tools for compiling source into installable .pkg.tar.xz packages.

ABS is not necessary to use Arch Linux, but it is useful for automating certain tasks of source compilation.

$ sudo pacman -S abs ; sudo abs
$ mkdir -p ~/abs ; cp /var/abs// ~/abs
$ $ cd ~/abs/ ; makepkg -s ; sudo pacman *.tar.xz 

It contains package descriptions PKGBUILDs that allow you to compile a package from source with makepkg and then install it via pacman.

# prerequisites
$ sudo pacman -S --needed base-devel

# manually 
$ mkdir ~/build ; cd $_
$ curl | tar xvf
$ cd  ; makepkg -s ; pacman -U *.tar.xz ; cd -
# list foreign packages
$ pacman -Qm 

# using as a
$ mkdir ~/build ; cd $_
$ curl | tar xvf
$ cd package-query ; makepkg -si ; cd -
$ curl | tar xvf
$ cd yaourt ; makepkg -si ; cd -

# install package
$ yaourt  or yaourt -Sa 
# sync database, upgrade packages, search aur and devel upgrades
$ yaourt -Syu --devel --aur
# build package from source
$ yaourt -Sb 

from yaourt


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s