< 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 (-S)

Install package(s) by name or zypper inemerge
Get source package(s) and build dependencies (zypper si) or emerge, or explicitly
Only print the targets instead of performing the actual operation (or )dnf --setopt=tsflags=test (or -s, --dry-run, ) ()
Toggle the manual confirmations or () or dnf --assumeno () () or zypper --no-confirm () ()
Refresh the local package repository (see the warnings about partial updates) or apt update or
Upgrade Packages - Install packages which have an older version already installedzypper update or
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.zypper dup
Remove a package(s) and all dependencies by name or zypper rm ()
Remove a package(s) and its configuration filespacman -Rn??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.pacman -Qmq | pacman -Rs -aptitude purge '~o'?
Mark a package previously installed as a dependency as explicitly required. (workaround which needs to reinstall the package) ()
Install package(s) as dependency / without marking as explicitly required.dnf install and then apt-mark auton/a (feature request) ()
Only downloads the given package(s) without unpacking or installing them (into the package cache) or (bypass the package cache) (-f)
Clean up all local caches. Options might limit what is actually cleaned.pacman -Sc or 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 /var/log/zypp/historyread
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
e-mail delivery of package changeseselect news read

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. or or or apt-cache policy or , emerge -pv or
Display local package information: Name, version, description, etc. / or or emerge -pv or
Display remote package information: Name, version, description, etc. or emerge -pv and or
Display files provided by local packagedpkg -Lequery files or
Display files provided by a remote package or (from package yum-utils)
Query the package which provides FILE (installed only) or (everything) or repoquery -f (from package yum-utils) or dlocate (installed only) or (everything) or
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. or zypper wp (only installed packages) or
Search all packages to find the one which holds the specified file. or is using this functionality. or
Show the changelog of a packageapt-get 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 apt list --upgradable or (just for patches)emerge -uDNp @world
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 (Cache only) or portageq all_best_visible /
Generates a list of installed packages
List packages that are installed but are not available in any installation source (anymore).dnf list extraseix-test-obsolete
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 version or or qlist -ICv
Search locally installed package for names or descriptionsrpm -qa '*<str>*'
List packages not required by any other package or
List packages installed explicitly (not as dependencies)dnf history userinstalledzypper 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. or dnf repoquery --alldeps --whatrequires or apt-cache rdepends or
Display packages which conflict with given expression (often package). Search can be used as well to mimic this function. or
List all packages which are required for the given package, aka show dependencies. or or apt-cache depends or
List what the current package provides or or zypper info --providesequery files or
List all packages that require a particular package or
Display all packages that the specified packages obsoletes. 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 /etc/pacman.confedit edit 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 /etc/pacman.confdnf config-manager or
Refresh the information about the specified installation source(s) or all installation sources. (always upgrade the whole system afterwards)dnf clean expire-cache and then or or
Prints a list of all installation sources including important information like URI, alias etc.apt-cache policy or or
List all packages from a certain repopaclist <repo> or zypper se -r <repo>
Disable an installation source for an operation
Download packages from a different version of the distribution than the one installed. or (dependencies not covered)zypper install -r <repo> package and then emerge package

Overrides

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Add a package lock rule to keep its current state from being changededit /etc/pacman.conf modifying IgnorePkg arrayedit adding/amending the option or put package name in
Delete a package lock ruleedit /etc/pacman.conf removing package from IgnorePkg linezypper rl or remove package name from (or )
Show a listing of all lock rules 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 /etc/pacman.conf modifying HoldPkg and/or IgnorePkg arrays, apt-cache policyedit adding a line with
Remove a previously set priorityedit removing offending line
Show a list of set prioritiesapt-cache policy or
Ignore problems that priorities may trigger.n/a

Verification and repair

ActionArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentoo
Verify single packagepacman -Qk (can add another )
Verify all packagespacman -Qk (can add another )
Reinstall given package; this will reinstall the given package without dependency hasslepacman -S
Verify dependencies of the complete system; used if installation process was forcefully killedapt-get check
Use some magic to fix broken dependencies in a systemfor pacman dependency level, use ; for shared library level, use or (from ) and then aptitude install
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/an/a
Undo a single specified transactionn/adnf history undon/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 database
List the contents of a package filerpm -qpl
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.cp package-filename /var/cache/pacman/pkg/n/a
Extract a package
Install/Remove packages to satisfy build-dependencies. Uses information in the source packageUse ABS and makepkg -seoc
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
Build a packagemakepkg -s (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.

gollark: You simply didn't notice.
gollark: I guessed years ago.
gollark: They have better power management nowadays.
gollark: Ignore neofetch, read the Intel spec sheet.
gollark: Not officially.

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.