Friday, September 16, 2011

Pacman Howto

Pacman is a simple but powerful package manager used in Archlinux. To start using it, you need to know few basic parameters briefly described here.
 Again pacman is very well documented on Arch's wiki. Here are some basic operations you'll need to know to work with pacman:

To skip certain package from being updated (during system update):
Add following line to the /etc/pacman.conf:
IgnorePkg=firstpackage secondpkg

Installing packages:
pacman -S pkg1 pkg2

Searching packages:
pacman -Ss some string

Removing packages:
pacman -R pkg
Remove package with all dependencies (those which are no longer needed):
pacman -Rs pkg

Update pacman DB (this you should do before each system update):
pacman -Syy

Uprading packages (system update):
pacman -Syu

Installing packages from AUR:
You can download packages build by the Arch users in AUR (Arch User Repository). Unpack the package run makepkg and as result the .xz file will be created. Then run following command to instal the package:
pacman -U pkg.xz


TIP: you can install yaourt which can search also the AUR repository for packages and automatically install them.

To upgrade all packages, including packages from AUR, use yaourt command:
yaourt -Syu --aur
 
Pacman stores all packages in cache directory. To remove this packages use:
pacman -Sc to remove all older packages (recently installed packages will remain in cache)
pacman -Scc to remove all packages from cache (by using this cmd you cannot revert to previous package versions, in case the next system update goes wrong, use this only if you know what you are doing)

Search for installed packages:
pacman -Qs some string

Display information about package:
pacman -Si pkg
Display information about installed package:
pacman -Qi pkg
Display to which package a file belongs:
pacman -Qo <file>

List of files installed by a package:
pacman -Ql pkg

List no longer needed packages (orphans):
pacman -Qdt

No comments:

Post a Comment