< Pacman

pacman/Rosetta

This page uses a table to display the correspondence of package management commands among some of the most popular Linux distributions. The original inspiration was given by openSUSE's Software Management Command Line Comparison.

Tip: Arch users having to temporarily deal with another Linux distribution can use pacapt, a simple wrapper around other package managers.

Basic operations

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.pacman -Ssdnf searchapt searchzypper search or zypper se [-s]emerge -S
Install a package(s) by namepacman -Sdnf install or emerge [-a]
Upgrade Packages - Install packages which have an older version already installeddnf upgrade and then or zypper up
Upgrade Packages - Another form of the update command, which can perform more complex updates -- like distribution upgrades. When the usual update command will omit package updates, which include changes in dependencies, this command can perform those updates. and then
Remove a package(s) and all dependencies by namednf remove or
Remove a package(s) and its configuration filespacman -Rn???
Remove a package(s) and all dependencies and configuration files???
Remove dependencies that are no longer needed (orphans), because e.g. the package which needed the dependencies was removed. (-Qdttq to ignore optional deps) (just for removing a package) or (listing only and without recursion)
Remove packages no longer included in any repositories.
Mark a package previously installed as a dependency as explicitly required.apt-mark manual (workaround which needs to reinstall the package)
Install package(s) as dependency / without marking as explicitly required.pacman -S --asdepsdnf install and then n/a (feature request) or
Only downloads the given package(s) without unpacking or installing them (into the package cache) or apt download (bypass the package cache)
Clean up all local caches. Options might limit what is actually cleaned. or apt autoclean removes only unneeded, obsolete information or
Start a shell to enter multiple commands in one sessionzypper shell
Show a log of actions taken by the software management.read read read read
Get a dump of the whole system information - Prints, Saves or similar the current state of the package management system. Preferred output is text or XML. (Note: Why either-or here? No tool offers the option to choose the output format.)see see apt-cache stats
e-mail delivery of package changes

Querying specific packages

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Show all or most information about a package. The tools' verbosity for the default command vary. But with options, the tools are on par with each other.pacman -Si or or or or zypper ifemerge -S, or
Display local package information: Name, version, description, etc. / or or or emerge -S
Display remote package information: Name, version, description, etc.pacman -Si or and emerge -S or equery meta
Display files provided by local packageequery files or
Display files provided by a remote package or (from package yum-utils)
Query the package which provides FILEpacman -Qo (installed only) or (everything) or (from package yum-utils) or (installed only) or (everything) or qfile
List the files that the package holds. Again, this functionality can be mimicked by other more complex commands. or equery files or
Displays packages which provide the given exp. aka reverse provides. Mainly a shortcut to search a specific field. Other tools might offer this functionality through the search command.apt-file search or (only installed packages) or
Search all packages to find the one which holds the specified file.apt-file search or is using this functionality. or qfile
Show the changelog of a package

Querying package lists

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.pacman -Ssdnf searchapt searchzypper search or zypper se -semerge -S or
Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options.dnf list updates or or (just for patches)
Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source. or apt-cache dump (Cache only) or
Generates a list of installed packagesqlist -IC
List packages that are installed but are not available in any installation source (anymore).apt --installed list | grep ,local
List packages that were recently added to one of the installation sources, i.e. which are new to it. or
List installed local packages along with versionrpm -qa or or rpm -qa
Search locally installed package for names or descriptionsaptitude search '~i(~n $name|~d $description)'
List packages not required by any other package or deborphan -anp1
List packages installed explicitly (not as dependencies) (workaround) or eix --selected
List packages installed automatically (as dependencies) (workaround)apt-mark showauto

Querying package dependencies

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Display packages which require X to be installed, aka show reverse dependencies. or or or
Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.pacman -Si or dnf repoquery --conflicts
List all packages which are required for the given package, aka show dependencies.pacman -Si or or or
List what the current package provides or dnf repoquery --provides or equery files or
List all packages that require a particular packageaptitude search ~D{depends,recommends,suggests}:$pattern or
Display all packages that the specified packages obsoletes.pacman -Si or
Generates an output suitable for processing with dotty for the given package(s).

Installation sources management

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Installation sources managementedit edit edit edit /etc/zypp/repos.d/${REPO}.repo or
Add an installation source to the system. Some tools provide additional commands for certain sources, others allow all types of source URI for the add command. Again others, like apt and dnf force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source.edit or overlays
Refresh the information about the specified installation source(s) or all installation sources. (always upgrade the whole system afterwards) and then or zypper ref or
Prints a list of all installation sources including important information like URI, alias etc. or eselect repository list
List all packages from a certain repo
Disable an installation source for an operationdnf --disablerepo=
Download packages from a different version of the distribution than the one installed. or (dependencies not covered) and then

Overrides

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Add a package lock rule to keep its current state from being changededit modifying IgnorePkg arrayedit adding/amending the exclude option or put package name in
Delete a package lock ruleedit removing package from IgnorePkg line or remove package name from (or )
Show a listing of all lock rulescat /etc/pacman.conf or view cat /etc/portage/package.mask
Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source.edit modifying HoldPkg and/or IgnorePkg arrays, edit adding a line with
Remove a previously set priorityedit removing offending line
Show a list of set priorities or
Ignore problems that priorities may trigger.n/a

Verification and repair

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Verify single package (can add another )rpm -Vrpm -V
Verify all packages (can add another )
Reinstall given package; this will reinstall the given package without dependency hasslepacman -Semerge -1O
Verify dependencies of the complete system; used if installation process was forcefully killedemerge -uDN @world
Use some magic to fix broken dependencies in a systemfor pacman dependency level, use ; for shared library level, use or (from ) and then
Add a checkpoint to the package system for later rollback(unnecessary, it is done on every transaction)n/a
Remove a checkpoint from the systemn/an/an/a
Provide a list of all system checkpointsn/an/a
Rolls entire packages back to a certain date or checkpointn/adnf history rollbackn/a
Undo a single specified transactionn/an/a

Using package files and building packages

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Query a package supplied on the command line rather than an entry in the package management databasepacman -Qp
List the contents of a package file
Install local package file, e.g. app.rpm and uses the installation sources to resolve dependenciesdnf installzypper in
Updates package(s) with local packages and uses the installation sources to resolve dependenciesdnf upgrade
Add a local package to the local package cache mostly for debugging purposes.n/a
Extract a packagerpm2cpio | cpio -vidrpm2cpio | cpio -vid
Install/Remove packages to satisfy build-dependencies. Uses information in the source packageUse ABS and dnf builddep
Display the source package to the given package name(s)n/a
Download the corresponding source package(s) to the given package name(s)Use ABS and dnf download --source or
Build a packagemakepkg -s (normal) or mock (in chroot), then build, and then or
Check for possible packaging issuesnamcap
(requires )
rpmlintlintianrpmlintrepoman

Log file rotation

By default, Arch Linux does not rotate pacman.log. See, for example, and . This is in contrast to the default policy of most other Linux distributions. Some distributions, notably Gentoo, hardly write log files by default.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.