Archlinux tools: Pacman
[ Friday, 26 October 2007, mikrobart ]
We are starting a short series of articles aiming to describe the key administration tools and packages used in Archlinux distribution. Today we are taking a closer look at Pacman — the Arch’s package manager of choice.
1. What exactly is Pacman?
Pacman is the default package manager for Arch Linux distribution. It is written for Arch Linux but its advantages were recognized also by other distribution developers (like Frugalware for example).
Pacman uses tar packages as a software source. Those packages are build to be compatible with Arch Linux Build System (ABS).
Pacman repositories do not have as many packages as repositories of the most popular distributions (like Debian, Ubuntu), but repositories are usually refreshed every day.
The main configuration file of Pacman is pacman.conf. It is located in /etc directory. This file contains e.g. repositories addresses or localization of the log file.
2. What can Pacman offer us?
Pacman basically enables us to:
- install and remove packages
- update packages
- update the whole system
- clean cache
- display information about installed packages
- display information about packages in a repository
- and all this using easy to remember commands.
3. How to use Pacman?
a) Packages installation:
pacman -Sy package_name - packages installation and local packages database synchronization
pacman -S package_name - packages installation along with dependencies
pacman -Sl repository_name - display packages list of a given repository
pacman -Sv package_name - information about operation
b) Removing packages:
pacman -R package_name - removing package without dependencies
pacman -Rs package_name - removing package along with dependencies
pacman -Rn package_name - purging package
c) System update:
pacman -Su - update all the packages
pacman -Syu - update all the packages and synchronize local packages database
d) Database queries:
pacman -Ss keyword - search for all packages matching the keyword (where the keyword is a part of the package name)
pacman -Qi package_name - information about package
pacman -Ql package_name - list files that a given package consist of
pacman -Qs package_name - search files installed on hard disk
e) Other commands:
pacman -Sw package_name - download package without installation
pacman -A /file/path/file.tar - install package
pacman -Sc - clean cache (old files)
pacman -Scc - clean cache (all files)
You can learn more commands typing
man pacman
.
4. How does repository entry look like?
Repository entry consist of the repository name (in brackets ‘[]‘) and server address (after ‘Server=’), Here’s an example from /etc/pacman.conf
[repository_name]
Server = ftp://server.net/repo
After you add a new repository you should refresh repositories list using the following command:
pacman -Sy
This was just a short introductory article to get you acquainted with the basics of using Pacman. All that can be found in the user’s manual but — according to my experience — people tend to skip the manuals. I hope we encouraged you to give Pacman and Archlinux a try in general. If so, keep track of the PolishLinux RSS because there is next article about Archlinux User-Community Repository (AUR) coming soon!
Subscribe to RSS feed for this article!
9 Comments
- A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
- Strong text: <strong>Strong text</strong>,
- Italic text: <em>italic text</em>,
- Strike: <strike>
strike</strike>, - Code: <code>
printf("hello world");</code>, - Block quote: <blockquote>Block quote</blockquote>

















“pacman -Ss password - search a new password in the database”
bad translation? :>
Yes, It should be “keyword” i think. Or package.
Of course. Corrected. Thanks.
Is there a pacman command to search package in the repository (not installed package)? Like “apt-cache search something”
Yes - ‘pacman -Ss keyword’
Nice article, however you forgot pacman’s most kickass feature: pacman -Rsc , that will delete the package, the packages that depend on it and the packages it depens on and those depend on (and so on) that aren’t required by any other package and weren’t explicitely installed.
…thus deleting your whole OS
hi pacman -A is deprecated. pacman -U takes care of that now.
There is also pacman -Rc, similar to -Rs but at the moment i can’t recall its purpose by itself, not forgetting -Rsc which is mentioned above. -Rsc won’t delete the whole OS heheh, its a handy tool to get rid of junk. To force remove there is -Rd. Anyway, i guess this is just an introduction for potential users so u don’t have to edit the article and slot in every detail.
Btw im posting to say thanks, i noticed a new option which is -Rn for purging! Damn my ignorance.
pacman -A is deprecated, should be pacman -U to install a package.