< 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
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
Search for package(s). What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. | pacman -Ss | dnf search | apt search | zypper search or zypper se [-s] | emerge --search (-s )
or |
Install package(s) by name | or zypper in | emerge | |||
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 installed | zypper 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 files | pacman -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 auto | n/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.log | read | read /var/log/zypp/history | 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 | |||
e-mail delivery of package changes | eselect news read | ||||
Querying specific packages
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
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 package | dpkg -L | equery 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 package | apt-get changelog | ||||
Querying package lists
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
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 -Ss | dnf search | apt search | zypper 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 extras | eix-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 descriptions | rpm -qa '*<str>*' | ||||
List packages not required by any other package | or | ||||
List packages installed explicitly (not as dependencies) | dnf history userinstalled | zypper search | grep -E '^i\+' (workaround) | or | ||
List packages installed automatically (as dependencies) | (workaround) | ||||
Querying package dependencies
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
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 --provides | equery 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
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
Installation sources management | edit /etc/pacman.conf | edit | 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.conf | dnf 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 repo | paclist <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
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
Add a package lock rule to keep its current state from being changed | edit /etc/pacman.conf modifying IgnorePkg array | edit adding/amending the option | or put package name in | ||
Delete a package lock rule | edit /etc/pacman.conf removing package from IgnorePkg line | zypper 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 policy | edit adding a line with | ||
Remove a previously set priority | edit removing offending line | ||||
Show a list of set priorities | apt-cache policy or | ||||
Ignore problems that priorities may trigger. | n/a | ||||
Verification and repair
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
Verify single package | pacman -Qk (can add another ) | ||||
Verify all packages | pacman -Qk (can add another ) | ||||
Reinstall given package; this will reinstall the given package without dependency hassle | pacman -S | ||||
Verify dependencies of the complete system; used if installation process was forcefully killed | apt-get check | ||||
Use some magic to fix broken dependencies in a system | for 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 system | n/a | n/a | n/a | ||
Provide a list of all system checkpoints | n/a | n/a | |||
Rolls entire packages back to a certain date or checkpoint | n/a | n/a | |||
Undo a single specified transaction | n/a | dnf history undo | n/a | ||
Using package files and building packages
Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
---|---|---|---|---|---|
Query a package supplied on the command line rather than an entry in the package management database | |||||
List the contents of a package file | rpm -qpl | ||||
Install local package file, e.g. app.rpm and uses the installation sources to resolve dependencies | dnf install | zypper in | emerge | ||
Updates package(s) with local packages and uses the installation sources to resolve dependencies | emerge | ||||
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 package | Use 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 package | makepkg -s | (normal) or mock (in chroot) | , then build, and then | or | |
Check for possible packaging issues | namcap (requires namcap) | rpmlint | lintian | rpmlint | repoman |
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: Topologically autoroute yourself UTTERLY, heavpoot.
gollark: It can't\* be that\*\* hard.
gollark: Thus, make metaesolang which does timing?
gollark: * difficulty of hardwaring
gollark: For network switching purposes.
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.