PACMAN(8)
๐ PACMAN(8) ๐
okay bestie, welcome to the pacman manual, part one of three ๐ this is the PACMAN(8) page from the Pacman Manual, and it's literally the whole vibe of Arch, no cap.
โจ NAME โจ
pacman โ package manager utility ๐
โจ SYNOPSIS โจ
pacman <operation> [options] [targets]
โจ DESCRIPTION โจ
so Pacman is a package management utility that keeps track of the installed packages on your Linux system. she's got range: dependency support, package groups, install and uninstall scripts, and the ability to sync your local machine with a remote repository so your packages just automatically upgrade themselves. icon behavior. ๐ฆ Pacman packages are a zipped tar format, iykyk.
Since version 3.0.0, pacman has been the front-end to libalpm(3), the โArch Linux Package Managementโ library. and the way that means other front-ends can be written too โ like, a GUI front-end could exist. main character library energy fr fr.
Invoking pacman means you're specifying an operation, plus any options and targets you wanna operate on. a target is usually a package name, file name, URL, or a search string. Targets go in as command line arguments. ALSO, important: if stdin is not from a terminal and a single hyphen (-) is passed as an argument, then targets will be read from stdin. noted. ๐
โจ OPERATIONS โจ
-D,--databaseโ Operate on the package database. This operation lets you modify certain attributes of the installed packages in pacman's database. It also lets you check the databases for internal consistency. See Database Options below.-Q,--queryโ Query the package database. This operation lets you view installed packages and their files, plus meta-information about individual packages (dependencies, conflicts, install date, build date, size). You can run this against the local package database or use it on individual package files. In the first case, if no package names are provided on the command line, all installed packages will be queried. Also, various filters can be applied on the package list. See Query Options below.-R,--removeโ Remove package(s) from the system. Groups can be specified too, and in that case every package in that group gets removed. Files belonging to the specified package will be deleted, and the database will be updated. Most configuration files will be saved with a.pacsaveextension unless the--nosaveoption is used. See Remove Options below.-S,--syncโ Synchronize packages. Packages are installed directly from the remote repositories, including all dependencies required to run the packages. For example,pacman -S qtwill download and install qt and all the packages it depends on. If a package name exists in more than one repository, the repository can be explicitly specified to clarify the package to install:pacman -S testing/qt. You can also specify version requirements:pacman -S "bash>=3.2". Quotes are needed, otherwise the shell interprets>as redirection to a file. ๐
In addition to packages, groups can be specified as well. For example, if gnome is a defined package group, then pacman -S gnome will provide a prompt allowing you to select which packages to install from a numbered list. The package selection is specified using a space- and/or comma-separated list of package numbers. Sequential packages may be selected by specifying the first and last package numbers separated by a hyphen (-). Excluding packages is achieved by prefixing a number or range of numbers with a caret (^). obsessed with this honestly.
Packages that provide other packages are also handled. For example, pacman -S foo will first look for a foo package. If foo is not found, packages that provide the same functionality as foo will be searched for. If any package is found, it will be installed. A selection prompt is provided if multiple packages providing foo are found.
You can also use pacman -Su to upgrade all packages that are out-of-date. See Sync Options below. When upgrading, pacman performs version comparison to determine which packages need upgrading. This behavior operates as follows:
Alphanumeric:
1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
Numeric:
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
Additionally, version strings can have an epoch value defined that will overrule any version comparison, unless the epoch values are equal. This is specified in an epoch:version-rel format. For example, 2:1.0-1 is always greater than 1:3.6-1. ๐ซถ
-T,--deptestโ Check dependencies; this is useful in scripts such asmakepkgto check installed packages. This operation will check each dependency specified and return a list of dependencies that are not currently satisfied on the system. This operation accepts no other options. Example usage:pacman -T qt "bash>=3.2".-U,--upgradeโ Upgrade or add package(s) to the system and install the required dependencies from sync repositories. Either a URL or file path can be specified. This is a โremove-then-addโ process. See Upgrade Options below; also see Handling Config Files for an explanation on how pacman takes care of configuration files.-F,--filesโ Query the files database. This operation lets you look for packages owning certain files, or display files owned by certain packages. Only packages that are part of your sync databases are searched. See File Options 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 โจ
-b,--dbpath<path> โ Specify an alternative database location (the default is/var/lib/pacman). This should not be used unless you know what you are doing. NOTE: If specified, this is an absolute path, and the root path is not automatically prepended.-r,--root<path> โ Specify an alternative installation root (default is/). This should not be used as a way to install software into/usr/localinstead of/usr. NOTE: If database path or log file are not specified on either the command line or inpacman.conf(5), their default location will be inside this root path. NOTE: This option is not suitable for performing operations on a mounted guest system. See--sysrootinstead.-v,--verboseโ Output paths such as the Root, Conf File, DB Path, Cache Dirs, etc. โจ--arch<arch> โ Specify an alternate architecture.--cachedir<dir> โ Specify an alternative package cache location (the default is/var/cache/pacman/pkg). Multiple cache directories can be specified, and they are tried in the order they are passed to pacman. NOTE: This is an absolute path, and the root path is not automatically prepended. IfDownloadUseris set inpacman.conf(5), then the specified user must have permission to access the cache directory.--color<when> โ Specify when to enable coloring. Valid options arealways,never, orauto.alwaysforces colors on;neverforces colors off; andautoonly automatically enables colors when outputting onto a tty.--config<file> โ Specify an alternate configuration file.--debugโ Display debug messages. When reporting bugs, this option is recommended to be used. ๐--gpgdir<dir> โ Specify a directory of files used by GnuPG to verify package signatures (the default is/etc/pacman.d/gnupg). This directory should contain two files:pubring.gpgandtrustdb.gpg.pubring.gpgholds the public keys of all packagers.trustdb.gpgcontains a so-called trust database, which specifies that the keys are authentic and trusted. NOTE: This is an absolute path, and the root path is not automatically prepended.--hookdir<dir> โ Specify a alternative directory containing hook files (the default is/etc/pacman.d/hooks). Multiple hook directories can be specified with hooks in later directories taking precedence over hooks in earlier directories. NOTE: This is an absolute path, and the root path is not automatically prepended.--logfile<file> โ Specify an alternate log file. This is an absolute path, regardless of the installation root setting.--noconfirmโ Bypass any and all โAre you sure?โ messages. It's not a good idea to do this unless you want to run pacman from a script. ๐ญ like bestie please read what you're doing.--confirmโ Cancels the effects of a previous--noconfirm.--disable-download-timeoutโ Disable defaults for low speed limit and timeout on downloads. Use this if you have issues downloading files with proxy and/or security gateway.--sysroot<dir> โ Specify an alternative system root. This path will be prepended to all other configuration directories and any repository servers beginning withfile://. Any paths or URLs passed as targets will not be modified. This allows mounted guest systems to be properly operated on. ๐ง--disable-sandboxโ Completely disables the sandbox applied to the process of downloading files on Linux systems. Equivalent to jointly specifying--disable-sandbox-filesystemand--disable-sandbox-syscalls.--disable-sandbox-filesystemโ Disable the filesystem restrictions part of the sandbox applied to the process downloading files on Linux systems. Useful if experiencing Landlock related failures while downloading files when running a Linux kernel that does not support this feature.--disable-sandbox-syscallsโ Disable the syscall filtering part of the sandbox applied to the process downloading files on Linux systems. Useful if experiencing seccomp related failures while downloading files when running a Linux kernel that does not support this feature.
that's part 1 bestie, part 2 is right there waiting for you ๐
๐ TRANSACTION OPTIONS (APPLY TO -S, -R AND -U) ๐
okay so these are the options that show up for the whole squad โ sync, remove and upgrade all share them. very versatile, very main character. โจ
-d,--nodepsโ skips dependency version checks. package names still get checked tho, don't get it twisted. normally pacman always be looking at a package's dependency fields to make sure all the deps are installed and there are no conflicts floating around in your system. pass this option twice to skip all dependency checks. yeah. twice. ๐--assume-installed <package=version>โ adds a virtual package called package with version version into the transaction so dependencies get satisfied. this is the โจsurgicalโจ move: it lets you disable one specific dependency check without nuking every check in the building. if you wanna disable all dependency checking, go see--nodepsabove, bestie.--dbonlyโ adds/removes the database entry only, leaving all the actual files right where they are. database says one thing, your filesystem says another, and we're all just living with it. ๐ซถ--noprogressbarโ no progress bar while downloading files. lowkey the move for scripts that call pacman and capture the output, because nobody wants a bar full of#####in their logs. ๐--noscriptletโ if an install scriptlet exists, don't execute it. > โ ๏ธ do not use this unless you genuinely know what you're doing. i'm serious. this is not a vibe-check-and-see situation. ๐ญ-p,--printโ only prints the targets instead of doing the actual operation (sync, remove or upgrade). use--print-formatto say how targets get displayed. the default format string is"%l", which shows URLs with-S, file names with-U, andpkgname-pkgverwith-R. it's giving "tell me what you would do" ๐--print-format <format>โ specify a printf-like format to control the output of the--printoperation. the possible attributes are, in this exact order:"%a"for arch"%b"for builddate"%d"for description"%e"for pkgbase"%f"for filename"%g"for base64 encoded PGP signature"%h"for sha256sum"%m"for md5sum"%n"for pkgname"%p"for packager"%v"for pkgver"%l"for location"%r"for repository"%s"for size"%C"for checkdepends"%D"for depends"%G"for groups"%H"for conflicts"%L"for licenses"%M"for makedepends"%O"for optional depends"%P"for provides"%R"for replaces
this one implies --print, so you don't gotta say both. ๐
๐ฅ UPGRADE OPTIONS (APPLY TO -S AND -U) ๐ฅ
for when you're syncing or upgrading. yes these two, no not remove. ๐
-w,--downloadonlyโ grab every package off the server, but install/upgrade nothing. just collecting them like little trinkets. ๐ธ--asdepsโ install packages non-explicitly; in other words, fake their install reason to be "installed as a dependency". this is literally made formakepkgand other build-from-source tools that need to install deps before they build the package. ๐ค--asexplicitโ install packages explicitly; in other words, fake their install reason to be "explicitly installed". use this when you wanna mark a dependency as explicit so it does not get swept away by the--recursiveremove operation. protect that little guy. ๐ก๏ธ--ignore <package>โ tells pacman to ignore upgrades of package even if there's one available. you can list multiple packages by separating them with a comma. โ--ignoregroup <group>โ tells pacman to ignore upgrades of every package in group, even if there's one available. multiple groups = comma separated. same energy, bigger scope. ๐ซ--neededโ don't reinstall the targets that are already up-to-date. we are not doing busywork today. ๐--overwrite <glob>โ bypass file conflict checks and overwrite the conflicting files. if the package about to be installed contains files that are already installed and match glob, this option makes all those files get overwritten. heads up tho:--overwritewill not let you overwrite a directory with a file, and it won't let you install packages with conflicting files and directories. multiple patterns = comma separated. it can also be specified multiple times. patterns can be negated (so files matching them will not be overwritten) by prefixing them with an exclamation mark. subsequent matches override previous ones. a leading literal exclamation mark or backslash needs to be escaped. ๐ฎโ๐จ
๐ QUERY OPTIONS (APPLY TO -Q) ๐
the detective arc. all of these are for -Q. ๐
-c,--changelogโ view the ChangeLog of a package, if one exists. receipts. ๐งพ-d,--depsโ restrict or filter the output to packages installed as dependencies. can be combined with-tto list real orphans โ packages that were installed as dependencies but are no longer required by any installed package. sad but free. ๐ฆ-e,--explicitโ restrict or filter the output to explicitly installed packages. combine it with-tto list explicitly installed packages that aren't required by any other package. ๐-g,--groupsโ display all packages that are members of a named group. if no name is specified, it lists all grouped packages. the whole friend group, assembled. ๐ฏ-i,--infoโ display information on a given package. you can use the-poption if you're querying a package file instead of the local database. and if you pass two--infoor-iflags, it'll also show you the list of backup files and their modification states. double the flag, double the lore. ๐-k,--checkโ check that all files owned by the given package(s) are actually present on the system. if no packages are specified or no filter flags are provided, it checks all installed packages. specifying this option twice does a more detailed file check (including permissions, file sizes, and modification times) for packages that contain the needed mtree file. thorough queen. ๐-l,--listโ list all files owned by a given package. multiple packages can be specified on the command line. ๐๏ธ-m,--foreignโ restrict or filter output to packages that were not found in the sync database(s). typically these are the ones you downloaded manually and installed with--upgrade. they're from out of town. โ๏ธ-n,--nativeโ restrict or filter output to packages that are found in the sync database(s). it's the exact inverse filter of--foreign. โญ-o,--owns <file>โ search for packages that own the specified file(s). the path can be relative or absolute, and you can specify one or more files. whose is this?? ๐ต๏ธ-p,--fileโ signifies that the package supplied on the command line is a file and not an entry in the database. the file gets decompressed and queried. super useful in combination with--infoand--list. ๐-q,--quietโ show less information for certain query operations. this one's made for when pacman's output gets processed in a script. here's the breakdown:searchwill only show package names and not version, group, and description infoownswill only show package names instead of"file is owned by pkg"messagesgroupwill only show package names and omit group nameslistwill only show files and omit package namescheckwill only show pairs of package names and missing files- a bare query will only show package names rather than names and versions
minimalism is a lifestyle. ๐คซ
-s,--search <regexp>โ search each locally-installed package for names or descriptions that match regexp. when you include multiple search terms, only packages whose descriptions match ALL of those terms get returned. all of them. no partial credit. ๐ฏ-t,--unrequiredโ restrict or filter output to print only packages neither required nor optionally required by any currently installed package. specify this option twice to also include packages which are optionally, but not directly, required by another package. ๐-u,--upgradesโ restrict or filter output to packages that are out-of-date on the local system. only package versions are used to find outdated packages; replacements are not checked here. this option works best if the sync database is refreshed using-Sy. glow-up check โจ
๐๏ธ REMOVE OPTIONS (APPLY TO -R) ๐๏ธ
for the deleting era. only -R gets these. ๐ซถ
-c,--cascadeโ remove all target packages, plus every package that depends on one or more of the target packages. > โ ๏ธ this operation is recursive and must be used with care, because it can remove a whole bunch of potentially needed packages. it's giving "i only pulled one thread". ๐ญ-n,--nosaveโ tells pacman to ignore file backup designations. normally, when a file is removed from the system, the database gets checked to see if that file should be renamed with a.pacsaveextension. this option says "nah, no keepsakes." ๐-s,--recursiveโ removes each target specified including all of their dependencies, provided that (A) they aren't required by other packages, and (B) they weren't explicitly installed by the user. this operation is recursive and analogous to a backwards--syncoperation, and it helps keep a clean system without orphans. if you wanna omit condition (B), pass this option twice. spring cleaning but make it ruthless ๐งน-u,--unneededโ removes targets that aren't required by any other packages. mostly useful when removing a group without using the-coption, so you avoid breaking any dependencies. polite deletion. ๐
๐ SYNC OPTIONS (APPLY TO -S)
These ones only do stuff when you're syncing, bestie. Lock in ๐
-c,--cleanโ bestie it's โจcleanup timeโจ. This yeets packages that aren't installed anymore out of the cache, plus any currently unused sync databases, so you get disk space back. Here's the tea: whenpacmandownloads packages it stashes them in a cache directory, and it also saves a database for every sync DB you download from โ and those databases do not get deleted even if you remove them from the config filepacman.conf(5). So: use one--cleanswitch to only remove packages that are no longer installed; use two to remove all files from the cache. Either way you get a yes-or-no prompt asking whether to remove packages and/or unused downloaded databases. ๐งน
If you use a network shared cache, check out theCleanMethodoption inpacman.conf(5).
-g,--groupsโ shows you every member of each package group you name. If you don't name any groups, it lists all of them; pass the flag twice to see all groups and their members. ๐-i,--infoโ drops info on a given sync database package. Pass--infoor-itwice and it'll also show you those packages in every repository that depends on this package. ๐-l,--listโ lists all the packages in the repositories you specify. You can name multiple repositories on the command line, go off. ๐-q,--quietโ shows less info for certain sync operations. Super useful whenpacman's output is being processed in a script. Specifically: search will only show package names and not repository, version, group, and description info; list will only show package names and omit databases and versions; group will only show package names and omit group names. ๐คซ-s,--search <regexp>โ searches every package in the sync databases for names or descriptions that matchregexp. And when you include multiple search terms, only packages with descriptions matching ALL of those terms get returned. No partial credit, periodt. ๐-u,--sysupgradeโ upgrades all packages that are out-of-date. Every currently-installed package gets examined and upgraded if a newer package exists. You'll get a report of all packages to upgrade first, and the operation will not proceed without user confirmation. Dependencies are automatically resolved at this level and will be installed/upgraded if necessary. ๐
Pass this option twice to enable package downgrades; in this case, pacman will select sync packages whose versions do not match with the local versions. This can be useful when the user switches from a testing repository to a stable one. ๐
Additional targets can also be specified manually, so that -Su foo will do a system upgrade and install/upgrade the foo package in the same operation. Two birds, one command. ๐๏ธ
-y,--refreshโ downloads a fresh copy of the master package databases (repo.db) from the server(s) defined inpacman.conf(5). You should typically use this every time you use--sysupgradeor-u. Passing two--refreshor-yflags will force a refresh of all package databases, even if they appear to be up-to-date. Forcing it, main character energy fr fr. ๐ซ
๐๏ธ DATABASE OPTIONS (APPLY TO -D)
--asdeps <package>โ marks a package as non-explicitly installed; in other words, sets its install reason to "installed as a dependency". ๐ซถ--asexplicit <package>โ marks a package as explicitly installed; in other words, sets its install reason to "explicitly installed". This is useful if you want to keep a package installed even when it was initially installed as a dependency of another package. ๐-k,--checkโ checks that the local package database is internally consistent. This checks all required files are present, and that installed packages have the required dependencies, do not conflict, and that multiple packages do not own the same file. Specifying this option twice will perform a check on the sync databases to ensure all specified dependencies are available. ๐ฉบ-q,--quietโ suppresses messages on successful completion of database operations. Silent but slaying. ๐ค
๐ FILE OPTIONS (APPLY TO -F)
-y,--refreshโ downloads fresh package file databases (repo.files) from the server. Use it twice to force a refresh even if the databases are up to date. ๐-l,--listโ lists the files owned by the queried package. ๐-x,--regexโ interprets each query as a regular expression. ๐ง-q,--quietโ shows less information for certain file operations. This is useful whenpacman's output is processed in a script, however, you may want to use--machinereadableinstead. ๐คซ--machinereadableโ prints each match in a machine readable output format. The format isrepository\0pkgname\0pkgver\0path\nwith\0being the NULL character and\na linefeed. Robots deserve nice things too. ๐ค
๐งฌ HANDLING CONFIG FILES
Okay bestie, this part is lowkey iconic โ pacman uses the same logic as rpm to decide what to do with files that are designated to be backed up. During an upgrade, three MD5 hashes are used for each backup file to figure out the required action: one for the original file installed, one for the new file that is about to be installed, and one for the actual file existing on the file system. After comparing these three hashes, here's what can go down:
original=X, current=X, new=Xโ all three files are the same, so overwrites are not an issue. Install the new file. โจoriginal=X, current=X, new=Yโ the current file is the same as the original, but the new one differs. Since the user did not ever modify the file, and the new one may contain improvements or bug fixes, install the new file. ๐original=X, current=Y, new=Xโ both package versions contain the exact same file, but the one on the file system has been modified. Leave the current file in place. ๐ โโ๏ธoriginal=X, current=Y, new=Yโ the new file is identical to the current file. Install the new file. ๐original=X, current=Y, new=Zโ all three files are different, so install the new file with a.pacnewextension and warn the user. The user must then manually merge any necessary changes into the original file. You've been warned, bestie, that merge is on you. โ ๏ธoriginal=NULL, current=Y, new=Zโ the package was not previously installed, and the file already exists on the file system. Install the new file with a.pacnewextension and warn the user. The user must then manually merge any necessary changes into the original file. Same deal, same drama. ๐ญ
๐ EXAMPLES
Real commands, real slay. Copy these exactly, they're verbatim:
pacman -Ss ne.hack
Search for regexp "ne.hack" in package database.
pacman -S gpm
Download and install gpm including dependencies.
pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz
Install ceofhack-0.6-1 package from a local file.
pacman -Syu
Update package list and upgrade all packages afterwards.
pacman -Syu gpm
Update package list, upgrade all packages, and then install gpm if it wasn't already installed.
โ๏ธ CONFIGURATION
See pacman.conf(5) for more details on configuring pacman using the pacman.conf file. That's the whole glow-up manual, go read it. ๐ซถ
๐ SEE ALSO
alpm-hooks(5), libalpm(3), makepkg(8), pacman.conf(5)
See the pacman website at https://archlinux.org/pacman/ for current information on pacman and its related tools. ๐
๐ BUGS
Bugs? You must be kidding; there are no bugs in this software. ๐ But if we happen to be wrong, please report them to the issue tracker at https://gitlab.archlinux.org/pacman/pacman/-/issues with specific information such as your command-line, the nature of the bug, and even the package database if it helps. Give us the receipts, bestie. ๐
๐ AUTHORS
Current maintainers:
- Allan McRae
<allan@archlinux.org> - Andrew Gregory
<andrew.gregory.8@gmail.com> - Morgan Adamiec
<morganamilo@archlinux.org>
Past major contributors:
- Judd Vinet
<jvinet@zeroflux.org> - Aurelien Foret
<aurelien@archlinux.org> - Aaron Griffin
<aaron@archlinux.org> - Dan McGee
<dan@archlinux.org> - Xavier Chantry
<shiningxc@gmail.com> - Nagy Gabor
<ngaba@bibl.u-szeged.hu> - Dave Reisner
<dreisner@archlinux.org> - Eli Schwartz
<eschwartz@archlinux.org>
For additional contributors, use git shortlog -s on the pacman.git repository. ๐ซก
and that's the whole page, bestie!! ๐โจ this masterpiece is Pacman 7.1.0, dated 2026-10-15, and it's the PACMAN(8) manual โ go forth and -Syu, you absolute icon ๐๐ฆ๐ธ
๐ฆ where this page comes from
- arch rolling: pacman 7.1.0.r9.g54d9411-3 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms