Content-type: text/html
Manpage of pacman
pacman
Section: (8)
Updated: January 20, 2003
Index
Return to Main Contents
NAME
pacman - package manager utility
SYNOPSIS
pacman <operation> [options] <package> [package] ...
DESCRIPTION
pacman is a package management utility that tracks installed
packages on a linux system. It has simple dependency support and the ability
to connect to a remote ftp server and automatically upgrade packages on
the local system. pacman package are gzipped tar format.
OPERATIONS
- -A, --add
-
Add a package to the system. Package will be uncompressed
into the installation root and the database will be updated.
- -R, --remove
-
Remove a package from the system. Files belonging to the
specified package will be deleted, and the database will
be updated. Most configuration files will be saved with a
.pacsave extension unless the --nosave option was
used.
- -U, --upgrade
-
Upgrade a package. This is essentially a "remove-then-add"
process. See HANDLING CONFIG FILES for an explanation
on how pacman takes care of config files.
- -F, --freshen
-
This is like --upgrade except that, unlike --upgrade, this will only
upgrade packages that are already installed on your system.
- -Q, --query
-
Query the package database. This operation allows you to
view installed packages and their files, as well as meta-info
about individual packages (dependencies, conflicts, install date,
build date, size). This can be run against the local package
database or can be used on individual .tar.gz packages. See
QUERY OPTIONS below.
- -S, --sync
-
Synchronize packages. With this function you can install packages
directly from the ftp servers, complete with all dependencies required
to run the packages. For example, pacman -S qt will download
qt and all the packages it depends on and install them. You could also use
pacman -Su to upgrade all packages that are out of date (see below).
- -V, --version
-
Display version and exit.
- -h, --help
-
Display syntax for the given operation. If no operation was
supplied then the general syntax is shown.
OPTIONS
- -v, --verbose
-
Output more status and error messages.
- -f, --force
-
Bypass file conflict checks,, overwriting conflicting files. If the
package that is about to be installed contains files that are already
installed, this option will cause all those files to be overwritten.
This option should be used with care, ideally not at all.
- -d, --nodeps
-
Skips all dependency checks. Normally, pacman will always check
a package's dependency fields to ensure that all dependencies are
installed and there are no package conflicts in the system. This
switch disables these checks.
- -n, --nosave
-
(only used with --remove)
Instructs pacman to ignore file backup designations. Normally, when
a file is about to be removed from the system the database is first
checked to see if the file should be renamed to a .pacsave extension. If
--nosave is used, these designations are ignored and the files are
removed.
- -r, --root <path>
-
Specify alternative installation root (default is "/"). This
should not be used as a way to install software into
e.g. /usr/local instead of /usr. Instead this should be used
if you want to install a package on a temporary mounted partition,
which is "owned" by another system. By using this option you not only
specify where the software should be installed, but you also
specify which package database to use.
SYNC OPTIONS
- -y, --refresh
-
Download a fresh copy of the master package list from the ftp server
defined in /etc/pacman.conf. This should typically be used each
time you use --sysupgrade.
- -u, --sysupgrade
-
Upgrades all packages that are out of date. pacman will examine every
package installed on the system, and if a newer package exists on the
server it will upgrade. pacman will present a report of all packages
it wants to upgrade and will not proceed without user confirmation.
Dependencies are automatically resolved at this level and will be
installed/upgraded if necessary.
- -s, --search <string>
-
This will search each package in the package list for names or descriptions
that contains <string>.
- -w, --downloadonly
-
Retrieve all packages from the server, but do not install/upgrade anything.
- -c, --clean
-
Remove packages from the cache. When pacman downloads packages,
it saves them in /var/cache/pacman/pkg. If you need to free up
diskspace, you can remove these packages by using the --clean option.
QUERY OPTIONS
- -o, --owns <file>
-
Search for the package that owns <file>.
- -l, --list
-
List all files owned by <package>. Multiple packages can be specified on
the command line.
- -i, --info
-
Display information on a given package. If it is used with the -p
option then the .PKGINFO file will be printed.
- -p, --file
-
Tells pacman that the package supplied on the command line is a
file, not an entry in the database. Pacman will decompress the
file and query it. This is useful with --info and --list.
HANDLING CONFIG FILES
pacman uses the same logic as rpm to determine action against files
that are designated to be backed up. During an upgrade, it uses 3
md5 hashes for each backup file to determine the required action:
one for the original file installed, one for the new file that's about
to be installed, and one for the actual file existing on the filesystem.
After comparing these 3 hashes, the follow scenarios can result:
- original=X, current=X, new=X
-
All three files are the same, so we win either way. Install the new file.
- original=X, current=X, new=Y
-
The current file is un-altered from the original but the new one is
different. Since the user did not ever modify the file, and the new
one may contain improvements/bugfixes, we install the new file.
- original=X, current=Y, new=X
-
Both package versions contain the exact same file, but the one
on the filesystem has been modified since. In this case, we leave
the current file in place.
- original=X, current=Y, new=Y
-
The new one is identical to the current one. Win win. Install the new file.
- original=X, current=Y, new=Z
-
All three files are different. So we install the new file, but back up the
old one to a .pacsave extension. This way the user can move the old configuration
file back into place if he wishes.
CONFIGURATION
pacman will attempt to read /etc/pacman.conf each time it is invoked. This
configuration file is divided into sections or repositories. Each section
defines a package repository that pacman can use when searching for packages in
--sync mode. The exception to this is the options section, which defines
global options.
Example:
-
[options]
NoUpgrade = etc/passed etc/group etc/shadow
NoUpgrade = etc/fstab
[current]
Server = ftp://ftp.server.org/linux/archlinux/current
Server = ftp://ftp.mirror.com/arch/current
[custom]
Server = local:///home/pkgs
All files listed with a NoUpgrade directive will never be touched during a package
install/upgrade. This directive is only valid in the options section.
Each repository section defines a section name and at least one location where the packages
can be found. The section name is defined by the string within square brackets (eg, the two
above are 'current' and 'custom'). Locations are defined with the Server directive and
follow a URL naming structure. Currently only ftp is supported for remote servers. If you
want to use a local directory, you can specify the full path with a 'local://' prefix, as
shown above.
USING YOUR OWN REPOSITORY
Let's say you have a bunch of custom packages in /home/pkgs and their respective PKGBUILD
files are all in /usr/abs/local. All you need to do is generate a compressed package database
in the /home/pkgs directory so pacman can find it when run with --refresh.
-
# gensync /usr/abs/local /home/pkgs/custom.db.tar.gz
The above command will read all PKGBUILD files in /usr/abs/local and generate a compressed
database called /home/pkgs/custom.db.tar.gz. Note that the database must be of the form
{treename}.db.tar.gz, where {treename} is the name of the section defined in the
configuration file.
That's it! Now configure your custom section in the configuration file as shown in the
config example above. Pacman will now use your package repository. If you add new packages to
the repository, remember to re-generate the database and use pacman's --refresh option.
SEE ALSO
makepkg is the package-building tool that comes with pacman.
AUTHOR
Judd Vinet <jvinet@zeroflux.org>
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPERATIONS
-
- OPTIONS
-
- SYNC OPTIONS
-
- QUERY OPTIONS
-
- HANDLING CONFIG FILES
-
- CONFIGURATION
-
- Example:
-
- USING YOUR OWN REPOSITORY
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 17:22:16 GMT, March 04, 2003