< 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) 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 zypper se [-s] | emerge -S |
| Install a package(s) by name | pacman -S | dnf install | or | emerge [-a] | |
| Upgrade Packages - Install packages which have an older version already installed | dnf 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 name | dnf remove | or | |||
| Remove a package(s) and its configuration files | pacman -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 --asdeps | dnf 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 session | zypper 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
| 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. | pacman -Si or | or | or | or zypper if | emerge -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 package | equery files or | ||||
| Display files provided by a remote package | or (from package yum-utils) | ||||
| Query the package which provides FILE | pacman -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
| 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 zypper se -s | emerge -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 packages | qlist -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 version | rpm -qa | or | or rpm -qa | ||
| Search locally installed package for names or descriptions | aptitude 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
| Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
|---|---|---|---|---|---|
| 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 package | aptitude 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
| Action | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo |
|---|---|---|---|---|---|
| Installation sources management | edit | 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 operation | dnf --disablerepo= | ||||
| Download packages from a different version of the distribution than the one installed. | or (dependencies not covered) | and then | |||
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 modifying IgnorePkg array | edit adding/amending the exclude option | or put package name in | ||
| Delete a package lock rule | edit removing package from IgnorePkg line | or remove package name from | (or ) | ||
| Show a listing of all lock rules | cat /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 priority | edit removing offending line | ||||
| Show a list of set priorities | 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 | (can add another ) | rpm -V | rpm -V | ||
| Verify all packages | (can add another ) | ||||
| Reinstall given package; this will reinstall the given package without dependency hassle | pacman -S | emerge -1O | |||
| Verify dependencies of the complete system; used if installation process was forcefully killed | emerge -uDN @world | ||||
| Use some magic to fix broken dependencies in a system | for 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 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 | dnf history rollback | n/a | ||
| Undo a single specified transaction | n/a | 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 | pacman -Qp | ||||
| List the contents of a package file | |||||
| Install local package file, e.g. app.rpm and uses the installation sources to resolve dependencies | dnf install | zypper in | |||
| Updates package(s) with local packages and uses the installation sources to resolve dependencies | dnf upgrade | ||||
| Add a local package to the local package cache mostly for debugging purposes. | n/a | ||||
| Extract a package | rpm2cpio | cpio -vid | rpm2cpio | cpio -vid | |||
| Install/Remove packages to satisfy build-dependencies. Uses information in the source package | Use 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 package | makepkg -s | (normal) or mock (in chroot) | , then build, and then | or | |
| Check for possible packaging issues | namcap (requires ) | rpmlint | lintian | rpmlint | repoman |
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.