Sei sulla pagina 1di 9

09/11/2016 Pacman/Rosetta - ArchWiki

Pacman/Rosetta
From ArchWiki
< Pacman

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 (http://old-
en.opensuse.org/Software_Management_Command_Line_Comparison).

Tip: Arch users having to temporarily deal with another Linux distribution can use pacapt (https://github.com/icy/pacapt), a simple wrapper around other
package managers.

Note:

Some of the tools described here are specific to a certain version of pacman. The -Qk option is new in pacman 4.1.
The command pkgfile can be found in the pkgfile (https://www.archlinux.org/packages/?name=pkgfile) package.

Contents
1 Basic operations
2 Querying specific packages
3 Querying package lists
4 Querying package dependencies
5 Installation sources management
6 Overrides
7 Verification and repair
8 Using package files and building packages
9 See also

Basic operations
Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
https://wiki.archlinux.org/index.php/Pacman/Rosetta 1/9
09/11/2016 Pacman/Rosetta - ArchWiki

zypper install
Install a package(s) by name pacman -S dnf install apt install emerge [-a]
zypper in
zypper remove
Remove a package(s) by name pacman -Rs dnf remove apt autoremove emerge -C
zypper rm
Search for package(s) by searching the expression in name,
description, short description. What exact fields are being zypper search
pacman -Ss dnf search apt search emerge -S
searched by default varies in each tool. Mostly options zypper se [-s]
bring tools on par.
Upgrade Packages - Install packages which have an older apt update; apt zypper update emerge -u
pacman -Syu dnf upgrade
version already installed upgrade zypper up world
Upgrade Packages - Another form of the update command,
which can perform more complex updates -- like
emerge -uDN
distribution upgrades. When the usual update command pacman -Syu dnf distro-sync apt full-upgrade zypper dup
world
will omit package updates, which include changes in
dependencies, this command can perform those updates.
Clean up all local caches. Options might limit what is apt-get clean /
pacman -Sc
actually cleaned. Autoclean removes only unneeded, dnf clean all apt-get autoclean zypper clean eclean distfiles
pacman -Scc
obsolete information. / aptitude clean
Remove dependencies that are no longer needed, because
pacman -Qdtq | apt-get emerge --
e.g. the package which needed the dependencies was dnf autoremove zypper rm -u
pacman -Rs - autoremove depclean
removed.
pacman -Qm | package-cleanup -- aptitude purge
Remove packages no longer included in any repositories.
pacman -Rs - orphans '~o'
Mark a package previously installed as a dependency as pacman -D --
dnf mark install apt-mark manual emerge --select
explicitly required. asexplicit
Install package(s) as dependency / without marking as dnf install => dnf aptitude install
pacman -S --asdeps emerge -1
explicitly required. mark remove '$package&M'
apt-get install --
download-only
(into the package
Only downloads the given package(s) without unpacking or cache) zypper --download- emerge --
pacman -Sw dnf download
installing them apt-get only fetchonly
download
(bypass the
package cache)
Start a shell to enter multiple commands in one session apt-config shell zypper shell
cat cat cat located in
https://wiki.archlinux.org/index.php/Pacman/Rosetta 2/9
09/11/2016 Pacman/Rosetta - ArchWiki

Show a log of actions taken by the software management. /var/log/pacman.log dnf history /var/log/dpkg.log /var/log/zypp/history /var/log/portage
Get a dump of the whole system information - Prints, Saves
or similar the current state of the package management
(see (see
system. Preferred output is text or XML. (Note: Why apt-cache stats n/a emerge --info
/var/lib/pacman/local) /var/lib/rpm/Packages)
either-or here? No tool offers the option to choose the
output format.)
apt-get install
e-mail delivery of package changes
apt-listchanges
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo

Querying specific packages


Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
emerge -S;
Show all or most information about a package. The tools' verbosity for the pacman apt show / apt- zypper info
dnf list, dnf info emerge -pv;
default command vary. But with options, the tools are on par with each other. -[S|Q]i cache policy zypper if
eix
emerge -pv
pacman dpkg -s / zypper info; rpm -
Display local package information: Name, version, description, etc. rpm -qi and emerge
-Qi aptitude show qi
-S
emerge -pv
pacman apt-cache show
Display remote package information: Name, version, description, etc. dnf info zypper info and emerge
-Si / aptitude show
-S
pacman
Display files provided by local package rpm -ql dpkg -L rpm -Ql equery files
-Ql
pkgfile apt-file list
Display files provided by a remote package dnf repoquery -l pfl
-l $pattern
rpm -qf (installed
pacman dpkg -S / equery
Query the package which provides FILE only) or dnf provides zypper search -f
-Qo dlocate belongs
(everything)
pacman
List the files that the package holds. Again, this functionality can be mimicked by -Ql
dnf repoquery -l dpkg-query -L rpm -ql equery files
other more complex commands. pkgfile
-l
equery
belongs

https://wiki.archlinux.org/index.php/Pacman/Rosetta 3/9
09/11/2016 Pacman/Rosetta - ArchWiki

Displays packages which provide the given exp. aka reverse provides. Mainly a pkgfile dnf provides apt-file search zypper what- (only
shortcut to search a specific field. Other tools might offer this functionality provides zypper installed
through the search command. wp packages);
pfl

Search all packages to find the one which holds the specified file. auto-apt is pkgfile equery
dnf provides apt-file search zypper search -f
using this functionality. -s belongs
pacman apt-get rpm -q -- equery
Show the changelog of a package rpm -q --changelog
-Qc changelog changelog changes -f
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo

Querying package lists


Red
Action Arch Debian/Ubuntu SLES/openSUSE Gentoo
Hat/Fedora
Search for package(s) by searching the expression in name, description, short
pacman zypper search zypper emerge
description. What exact fields are being searched by default varies in each tool. dnf search apt search
-Ss se [-s] -S
Mostly options bring tools on par.
dnf list
zypper list-updates emerge
Lists packages which have an update available. Note: Some provide special pacman updates, dnf
apt-get upgrade -> n zypper patch-check -uDNp
commands to limit the output to certain installation sources, others use options. -Qu check-
(just for patches) world
update
Display a list of all packages in all installation sources that are handled by the apt-cache dumpavail apt- emerge
pacman dnf list
packages management. Some tools provide options or additional commands to cache dump (Cache only) zypper packages -ep
-Sl available
limit the output to a specific installation source. apt-cache pkgnames world
emerge
pacman dnf list zypper search --
Generates a list of installed packages dpkg --list | grep ^i -ep
-Q installed installed-only
world
List packages that are installed but are not available in any installation source pacman dnf list zypper se -si | grep eix-test-
deborphan
(anymore). -Qm extras 'System Packages' obsolete
List packages that were recently added to one of the installation sources, i.e. dnf list aptitude search '~N' /
(none) n/a eix-diff
which are new to it. recent aptitude forget-new
pacman zypper search -s; rpm emerge
List installed local packages along with version rpm -qa dpkg -l
-Q -qa -e world
pacman rpm -qa '* aptitude search '~i(~n
Search locally installed package for names or descriptions eix -S -I
-Qs <str>*' $name|~d $description)'
https://wiki.archlinux.org/index.php/Pacman/Rosetta 4/9
09/11/2016 Pacman/Rosetta - ArchWiki

pacman package-
List packages not required by any other package cleanup --all deborphan -anp1
-Qt
--leaves
pacman
List packages installed explicitly (not as dependencies) apt-mark showmanual
-Qe
pacman
List packages installed automatically (as dependencies) apt-mark showauto
-Qd
Red
Action Arch Debian/Ubuntu SUSE/openSUSE Gentoo
Hat/Fedora

Querying package dependencies


Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
dnf repoquery --
Display packages which require X to be installed, aka pacman apt-cache rdepends / aptitude search zypper search -- equery
alldeps --
show reverse dependencies. -Sii ~D$pattern requires depends
whatrequires
Display packages which conflict with given expression
dnf repoquery --
(often package). Search can be used as well to mimic this aptitude search '~C$pattern'
conflicts
function.
List all packages which are required for the given package, pacman dnf repoquery -- zypper info -- emerge
apt-cache depends / apt-cache show
aka show dependencies. -[S|Q]i requires requires -ep
zypper info -- equery
List what the current package provides dnf provides dpkg -s / aptitude show
provides files
dnf repoquery -- aptitude search equery
zypper search --
List all packages that require a particular package alldeps -- ~D{depends,recommends,suggests}:$pattern depends
requires
whatrequires / aptitude why -a
Display all packages that the specified packages obsoletes. dnf list obsoletes apt-cache show
Generates an output suitable for processing with dotty for
apt-cache dotty n/a
the given package(s).
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo

Installation sources management


Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
Installation
https://wiki.archlinux.org/index.php/Pacman/Rosetta 5/9
09/11/2016 Pacman/Rosetta - ArchWiki

sources ${EDITOR} ${EDITOR} ${EDITOR} ${EDITOR} layman


management /etc/pacman.conf /etc/yum.repos.d/${REPO}.repo /etc/apt/sources.list /etc/zypp/repos.d/${REPO}.repo
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
/etc/pacman.conf /etc/yum.repos.d/*.repo apt-cdrom add zypper service-add layman, overlays
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.
Refresh the
information about
the specified pacman -Sy (always
dnf clean expire-cache && dnf
installation upgrade the whole apt-get update zypper refresh zypper ref emerge --sync;layman -S
check-update
source(s) or all system afterwards)
installation
sources.
Prints a list of all
installation
sources including cat
cat /etc/yum.repos.d/* apt-cache policy zypper service-list layman -l
important /etc/pacman.d/mirrorlist
information like
URI, alias etc.
Disable an
installation source dnf --disablerepo= emerge package::repo-to-use
for an operation
https://wiki.archlinux.org/index.php/Pacman/Rosetta 6/9
09/11/2016 Pacman/Rosetta - ArchWiki

Download apt-get install -t


packages from a echo "category/package
release package/
different version ~amd64" >>
dnf --releasever= apt-get install
of the distribution /etc/portage/package.keywords
package/release
than the one && emerge package
(deps not covered)
installed.
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo

Overrides
Red
Action Arch Debian/Ubuntu SLES/openSUSE Gentoo
Hat/Fedora
dnf.conf <-
/etc/pacman.conf Put package name
Add a package lock rule to keep its current state from -exclude
modify IgnorePkg apt-mark hold pkg in /etc/zypp/locks, /etc/portage/package.mask
being changed option
array or zypper al
(add/amend)
Remove package
remove package
apt-mark unhold name from /etc/portage/package.mask (or
Delete a package lock rule from IgnorePkg line
pkg /etc/zypp/locks or package.unmask)
in /etc/pacman.conf
zypper rl
View
cat
Show a listing of all lock rules /etc/apt/preferences /etc/zypp/locks or cat /etc/portage/package.mask
/etc/pacman.conf
zypper ll
${EDITOR}
Set the priority of the given package to avoid ${EDITOR}
/etc/pacman.conf
upgrade, force downgrade or to overwrite any default /etc/apt/preferences, /etc/portage/package.keywords
Modify HoldPkg zypper mr -p
behavior. Can also be used to prefer a package apt-cache policy Add a line with
and/or IgnorePkg
version from a certain installation source. =category/package-version
arrays
${EDITOR}
Remove a previously set priority /etc/apt/preferences zypper mr -p /etc/portage/package.keywords
remove offending line
apt-cache policy cat
Show a list of set priorities. zypper lr -p
/etc/apt/preferences /etc/portage/package.keywords
Ignores problems that priorities may trigger. n/a
Red
Action Arch Debian/Ubuntu SUSE/openSUSE Gentoo
Hat/Fedora

https://wiki.archlinux.org/index.php/Pacman/Rosetta 7/9
09/11/2016 Pacman/Rosetta - ArchWiki

Verification and repair


Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
equery
Verify single package pacman -Qk[k] rpm -V debsums rpm -V
check
equery
Verify all packages pacman -Qk[k] rpm -Va debsums rpm -Va
check
Reinstall given Package - Will reinstall the given apt install -- zypper install -- emerge
pacman -S dnf reinstall
package without dependency hassle. reinstall force [-a]
emerge
Verify dependencies of the complete system. Used dnf repoquery --
pacman -Dk apt-get check zypper verify -uDN
if installation process was forcefully killed. requires
world
apt-get --fix-
Use some magic to fix broken dependencies in a pacman dep level - pacman -Dk, shared dnf repoquery -- revdep-
broken zypper verify
system lib level - findbrokenpkgs or lddd unsatisfied rebuild
aptitude install
Add a checkpoint to the package system for later (unnecessary, done on
n/a
rollback every transaction)
Remove a checkpoint from the system N/A N/A n/a
Provide a list of all system checkpoints N/A dnf history list n/a
Rolls entire packages back to a certain date or
N/A dnf history rollback n/a
checkpoint.
Undo a single specified transaction. N/A dnf history undo n/a
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo

Using package files and building packages


Red
Action Arch Debian/Ubuntu SLES/openSUSE Gentoo
Hat/Fedora
Query a package supplied on the command line rather than an
pacman -Qp rpm -qp dpkg -I
entry in the package management database
rpmls rpm -
List the contents of a package file pacman -Qpl dpkg -c rpm -qpl
qpl
Installs local package file, e.g. app.rpm and uses the installation
pacman -U dnf install apt install zypper in emerge
sources to resolve dependencies

https://wiki.archlinux.org/index.php/Pacman/Rosetta 8/9
09/11/2016 Pacman/Rosetta - ArchWiki

Updates package(s) with local packages and uses the installation pacman -U dnf upgrade debi emerge
sources to resolve dependencies
Add a local package to the local package cache mostly for cp $filename cp $filename
apt-cache add n/a
debugging purposes. /var/cache/pacman/pkg/ /usr/portage/distfiles
rpm2cpio | rpm2cpio | cpio -
Extract a package tar -Jxvf dpkg-deb -x tar -jxvf
cpio -vid vid
Install/Remove packages to satisfy build-dependencies. Uses
automatic dnf builddep apt-get build-dep zypper si -d emerge -o
information in the source package.
dnf apt-cache
Display the source package to the given package name(s) n/a
repoquery -s showsrc
dnf
Downloads the corresponding source package(s) to the given Use ABS && makepkg apt-get source / zypper source-
download -- emerge --fetchonly
package name(s) -o debcheckout install
source
rpmbuild -ba
(normal) rpmbuild -ba;
Build a package makepkg -s debuild ebuild; quickpkg
mock (in build; osc build
chroot)
Check for possible packaging issues namcap rpmlint lintian rpmlint repoman
Red
Action Arch Debian/Ubuntu SUSE/openSUSE Gentoo
Hat/Fedora

See also
Changes in DNF CLI compared to Yum (http://dnf.readthedocs.org/en/latest/cli_vs_yum.html)

Retrieved from "https://wiki.archlinux.org/index.php?title=Pacman/Rosetta&oldid=456291"

Category: Package management

This page was last modified on 7 November 2016, at 15:50.


Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.

https://wiki.archlinux.org/index.php/Pacman/Rosetta 9/9

Potrebbero piacerti anche