< 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). 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 --search (-s)

or emerge --searchdesc ()

Install package(s) by name or zypper inemerge
Get source package(s) and build dependencies () or emerge, or explicitly
Only print the targets instead of performing the actual operation (or )dnf --setopt=tsflags=test (or -s, , --just-print) ()
Toggle the manual confirmations or () or dnf --assumeno () (-n) or () ()
Refresh the local package repository (see the warnings about partial updates) or zypper refresh or
Upgrade Packages - Install packages which have an older version already installed or emerge -[a]uDN @world
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.apt dist-upgradeemerge -[a]uDN @world
Remove a package(s) and all dependencies by name or ()
Remove a package(s) and its configuration filespacman -Rn?apt purge?n/a
Remove a package(s) and all dependencies and configuration files??n/a
Remove dependencies that are no longer needed (orphans), because e.g. the package which needed the dependencies was removed. ( to also remove optional deps) (just for removing a package) or (listing only and without recursion) ()
Remove packages no longer included in any repositories.aptitude purge '~o'?
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. and then n/a (feature request) (-1)
Only downloads the given package(s) without unpacking or installing them (into the package cache) or (bypass the package cache)zypper --download-only ()
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 session
Show a log of actions taken by the software management.read /var/log/pacman.logread 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 /var/lib/pacman/localsee
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 apt-cache policy or , or
Display local package information: Name, version, description, etc.rpm -qi / or or rpm -qi or
Display remote package information: Name, version, description, etc.pacman -Si or and or
Display files provided by local packagepacman -Ql or
Display files provided by a remote packagednf repoquery -l or (from package yum-utils)
Query the package which provides FILE (installed only) or dnf provides (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.pacman -Ql or dnf repoquery -l 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.dnf provides or (only installed packages) or
Search all packages to find the one which holds the specified file.dnf provides or auto-apt is using this functionality. or qfile
Show the changelog of a packagerpm -q --changelog

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 or
Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options. or zypper list-updates 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.apt-cache dumpavail or (Cache only) or
Generates a list of installed packagesdnf list installed
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 aptitude forget-new
List installed local packages along with version or or
Search locally installed package for names or descriptionsrpm -qa '*<str>*'
List packages not required by any other packagepacman -Qtt or
List packages installed explicitly (not as dependencies)zypper search | grep -E '^i\+' (workaround) or
List packages installed automatically (as dependencies) (workaround)

Querying package dependencies

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Display packages which require X to be installed, aka show reverse dependencies.pacman -Sii or or or aptitude search ~D$pattern
Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.pacman -Si or
List all packages which are required for the given package, aka show dependencies.pacman -Si or or repoquery -R or
List what the current package providespacman -Sii or or zypper info --provides or
List all packages that require a particular packagepacman -Sii 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 /etc/yum.repos.d/${REPO}.repoedit edit 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 force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source.edit dnf config-manager or
Refresh the information about the specified installation source(s) or all installation sources. (always upgrade the whole system afterwards) and then zypper refresh or or layman -S
Prints a list of all installation sources including important information like URI, alias etc.apt-cache policy or or eselect repository list
List all packages from a certain repo or
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)echo "category/package ~amd64" >> /etc/portage/package.keywords 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 optionapt-mark hold pkg 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 rules/etc/apt/preferences or view
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/etc/apt/preferences, apt-cache policyedit adding a line with =category/package-version
Remove a previously set priority/etc/apt/preferencesedit removing offending line
Show a list of set prioritiesapt-cache policy or /etc/apt/preferences
Ignore problems that priorities may trigger.n/a

Verification and repair

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Verify single package (can add another )debsums
Verify all packages (can add another )debsums
Reinstall given package; this will reinstall the given package without dependency hassleapt install --reinstall
Verify dependencies of the complete system; used if installation process was forcefully killed
Use some magic to fix broken dependencies in a systemfor pacman dependency level, use ; for shared library level, use findbrokenpkgsAUR 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/adnf history listn/a
Rolls entire packages back to a certain date or checkpointn/an/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 databaserpm -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 inemerge
Updates package(s) with local packages and uses the installation sources to resolve dependenciesemerge
Add a local package to the local package cache mostly for debugging purposes.apt-cache add package-filenamen/a
Extract a package
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 makepkg -o or zypper source-install
Build a package (normal) or mock (in chroot), then build, and then or
Check for possible packaging issuesnamcap
(requires namcap)
rpmlintlintianrpmlintrepoman

Log file rotation

By default, Arch Linux does not rotate . 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.