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!

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: Arch

 more »

Related articles: Software managers

 more »

PolishLinux Top Content


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads