Linux Terminal Commands
Linux Terminal Commands
php/Pacman/Rosetta
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.
Updates
package(s)
with local
packages and
uses the pacman -U dnf upgrade debi emerge
installation
sources to
resolve
dependencies
pacman dep
Use some
level - pacman
magic to fix
-Dk, shared lib dnf repoquery apt-get --fix-broken
broken zypper verify revdep-rebuild
level - --unsatisfied aptitude install
dependencies
findbrokenpkgs
in a system
or lddd
Only
downloads the
given apt-get install --download-only (into the
zypper
package(s) pacman -Sw dnf download package cache) emerge --fetchonly
--download-only
without apt-get download (bypass the package cache)
unpacking or
installing them
Remove
dependencies
that are no
longer needed,
because e.g. pacman -Qdtq |
dnf autoremove apt-get autoremove zypper rm -u emerge --depclean
the package pacman -Rs -
which needed
the
dependencies
was removed.
Downloads the
corresponding
source
Use ABS && dnf download zypper source-
package(s) to apt-get source / debcheckout emerge --fetchonly
makepkg -o --source install
the given
package
name(s)
Remove
packages no
pacman -Qm | package-cleanup
longer aptitude purge '~o'
pacman -Rs - --orphans
included in any
repositories.
Install/Remove
packages to
satisfy build-
dependencies.
automatic dnf builddep apt-get build-dep zypper si -d emerge -o
Uses
information in
the source
package.
Add a package
lock rule to dnf.conf Put package
/etc/pacman.conf
keep its <--”exclude” name in /etc/zypp /etc/portage
modify apt-mark hold pkg
current state option /locks, or zypper /package.mask
IgnorePkg array
from being (add/amend) al
changed
remove package Remove package
Delete a /etc/portage
from IgnorePkg name from
package lock apt-mark unhold pkg /package.mask (or
line in /etc/zypp/locks or
rule package.unmask)
/etc/pacman.conf zypper rl
Show a listing cat View /etc/zypp cat /etc/portage
/etc/apt/preferences
of all lock rules /etc/pacman.conf /locks or zypper ll /package.mask
Add a
checkpoint to (unnecessary,
the package done on every n/a
system for transaction)
later rollback
Remove a
checkpoint
N/A N/A n/a
from the
system
Provide a list
of all system N/A dnf history list n/a
checkpoints
Rolls entire
packages back
dnf history
to a certain N/A n/a
rollback
date or
checkpoint.
Undo a single
specified N/A dnf history undo n/a
transaction.
Mark a
pacman -D
package dnf mark install apt-mark manual emerge --select
--asexplicit
previously
installed as a
dependency as
explicitly
required.
Install
package(s) as
dependency /
pacman -S dnf install => dnf
without aptitude install '$package&M' emerge -1
--asdeps mark remove
marking as
explicitly
required.
Package
information
management
Get a dump of
the whole
system
information -
Prints, Saves
or similar the
current state of
the package
management
(see /var/lib (see /var/lib
system. apt-cache stats n/a emerge --info
/pacman/local) /rpm/Packages)
Preferred
output is text
or XML. (Note:
Why either-or
here? No tool
offers the
option to
choose the
output format.)
Show all or
most
information
about a
package. The
tools' verbosity
zypper info emerge -S; emerge
for the default pacman -[S|Q]i dnf list, dnf info apt show / apt-cache policy
zypper if -pv; eix
command vary.
But with
options, the
tools are on
par with each
other.
Search for
package(s) by
searching the
expression in
name,
description,
short
description. zypper search
pacman -Ss dnf search apt search emerge -S
What exact zypper se [-s]
fields are being
searched by
default varies
in each tool.
Mostly options
bring tools on
par.
Display rpm -q
apt-get changelog
changelogs --changelog
e-mail delivery
of package apt-get install apt-listchanges
changes
Lists packages
which have an
update
available.
zypper
Note: Some
list-updates
provide special dnf list updates, emerge -uDNp
pacman -Qu apt-get upgrade -> n zypper
commands to dnf check-update world
patch-check (just
limit the output
for patches)
to certain
installation
sources, others
use options.
Display a list of
all packages in
all installation
sources that apt-cache dumpavail apt-cache dump (Cache
pacman -Sl dnf list available zypper packages emerge -ep world
are handled by only) apt-cache pkgnames
the packages
management.
Some tools
provide options
or additional
commands to
limit the output
to a specific
installation
source.
Displays
packages
which provide
the given exp.
aka reverse
provides.
Mainly a
zypper equery belongs
shortcut to
pkgfile dnf provides apt-file search what-provides (only installed
search a
zypper wp packages); pfl
specific field.
Other tools
might offer this
functionality
through the
search
command.
Display
packages
which require dnf repoquery
apt-cache rdepends / aptitude search zypper search
X to be pacman -Sii --alldeps equery depends
~D$pattern --requires
installed, aka --whatrequires
show reverse
dependencies.
Display
packages
which conflict
with given
expression
dnf repoquery
(often aptitude search '~C$pattern'
--conflicts
package).
Search can be
used as well to
mimic this
function.
List all
packages
which are
required for dnf repoquery zypper info
pacman -[S|Q]i apt-cache depends / apt-cache show emerge -ep
the given --requires --requires
package, aka
show
dependencies.
List what the
current zypper info
dnf provides dpkg -s / aptitude show equery files
package --provides
provides
List the files
that the
package holds.
Again, this
functionality pacman -Ql
dnf repoquery -l dpkg-query -L rpm -ql equery files
can be pkgfile -l
mimicked by
other more
complex
commands.
List all
packages that dnf repoquery aptitude search
zypper search
require a --alldeps ~D{depends,recommends,suggests}:$pattern equery depends -a
--requires
particular --whatrequires / aptitude why
package
Search all
packages to
find the one
which holds
pkgfile -s dnf provides apt-file search zypper search -f equery belongs
the specified
file. auto-apt is
using this
functionality.
Display all
packages that
the specified dnf list obsoletes apt-cache show
packages
obsoletes.
Verify
dependencies
of the complete dnf repoquery
pacman -Dk apt-get check zypper verify emerge -uDN world
system. Used if --requires
installation
process was
forcefully
killed.
Generates a
zypper search
list of installed pacman -Q dnf list installed dpkg --list | grep ^i emerge -ep world
--installed-only
packages
List packages
that are
installed but
zypper se -si |
are not
pacman -Qm dnf list extras deborphan grep 'System eix-test-obsolete
available in
Packages'
any installation
source
(anymore).
List packages
that were
recently added
to one of the
(none) dnf list recent aptitude search '~N' / aptitude forget-new n/a eix-diff
installation
sources, i.e.
which are new
to it.
Show a log of
actions taken cat /var/log cat /var/log located in /var/log
dnf history cat /var/log/dpkg.log
by the software /pacman.log /zypp/history /portage
management.
Clean up all
local caches.
Options might
limit what is
actually
pacman -Sc apt-get clean / apt-get autoclean / aptitude
cleaned. dnf clean all zypper clean eclean distfiles
pacman -Scc clean
Autoclean
removes only
unneeded,
obsolete
information.
Add a local
package to the
cp $filename cp $filename
local package
/var/cache apt-cache add n/a /usr/portage
cache mostly
/pacman/pkg/ /distfiles
for debugging
purposes.
Display the
source
package to the dnf repoquery -s apt-cache showsrc n/a
given package
name(s)
Generates an
output suitable
for processing
apt-cache dotty n/a
with dotty for
the given
package(s).
Set the priority
of the given
package to
avoid upgrade,
force
downgrade or ${EDITOR} ${EDITOR}
to overwrite /etc/pacman.conf /etc/portage
any default Modify HoldPkg /package.keywords
/etc/apt/preferences, apt-cache policy zypper mr -p
behavior. Can and/or Add a line with
also be used to IgnorePkg =category/package-
prefer a arrays version
package
version from a
certain
installation
source.
${EDITOR}
Remove a /etc/portage
previously set /etc/apt/preferences zypper mr -p /package.keywords
priority remove offending
line
Show a list of cat /etc/portage
apt-cache policy /etc/apt/preferences zypper lr -p
set priorities. /package.keywords
Ignores
problems that
n/a
priorities may
trigger.
Installation ${EDITOR} ${EDITOR}
${EDITOR}
sources /etc/yum.repos.d ${EDITOR} /etc/apt/sources.list /etc/zypp/repos.d layman
/etc/pacman.conf
management /${REPO}.repo /${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
command. /etc/yum.repos.d zypper
/etc/pacman.conf apt-cdrom add layman, overlays
Again others, /*.repo service-add
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
pacman -Sy
about the
(always upgrade dnf clean
specified zypper refresh emerge
the whole expire-cache && apt-get update
installation zypper ref --sync;layman -S
system dnf check-update
source(s) or all
afterwards)
installation
sources.
Prints a list of
all installation
sources
cat
including cat
/etc/pacman.d apt-cache policy zypper service-list layman -l
important /etc/yum.repos.d/*
/mirrorlist
information
like URI, alias
etc.
Disable an
emerge
installation dnf
package::repo-
source for an --disablerepo=
to-use
operation
Download echo
packages from "category/package
a different ~amd64" >>
apt-get install -t release package/ apt-get
version of the dnf --releasever= /etc/portage
install package/release (deps not covered)
distribution /package.keywords
than the one && emerge
installed. package
Other
commands
Start a shell to
enter multiple
apt-config shell zypper shell
commands in
one session
Package
Verification
Single package pacman -Qk[k] rpm -V debsums rpm -V equery check
All packages pacman -Qk[k] rpm -Va debsums rpm -Va equery check
Package
Querying
List installed
local packages zypper search -s;
pacman -Q rpm -qa dpkg -l emerge -e world
along with rpm -qa
version
Display local
package
information: zypper info; rpm emerge -pv and
pacman -Qi rpm -qi dpkg -s / aptitude show
Name, version, -qi emerge -S
description,
etc.
Display remote
package
information: emerge -pv and
pacman -Si dnf info apt-cache show / aptitude show zypper info
Name, version, emerge -S
description,
etc.
Display files
provided by pacman -Ql rpm -ql dpkg -L rpm -Ql equery files
local package
Display files
provided by a
pkgfile -l dnf repoquery -l apt-file list $pattern pfl
remote
package
rpm -qf (installed
Query the
only) or dnf
package which pacman -Qo dpkg -S / dlocate zypper search -f equery belongs
provides
provides FILE
(everything)
Query a
package
supplied on the
command line
rather than an pacman -Qp rpm -qp dpkg -I
entry in the
package
management
database
Show the
rpm -q
changelog of a pacman -Qc apt-get changelog equery changes -f
--changelog
package
Search locally
installed
aptitude search '~i(~n $name|~d
package for pacman -Qs rpm -qa '*<str>*' eix -S -I
$description)'
names or
descriptions
List packages
not required by package-cleanup
pacman -Qt deborphan -anp1
any other --all --leaves
package
List packages
installed
explicitly (not pacman -Qe apt-mark showmanual
as
dependencies)
List packages
installed
automatically pacman -Qd apt-mark showauto
(as
dependencies)
Building
Packages
rpmbuild -ba
Build a rpmbuild -ba;
makepkg -s (normal) debuild ebuild; quickpkg
package build; osc build
mock (in chroot)
Check for
possible
namcap rpmlint lintian rpmlint repoman
packaging
issues
List the
contents of a pacman -Qpl rpmls rpm -qpl dpkg -c rpm -qpl
package file
Extract a rpm2cpio | cpio rpm2cpio | cpio
tar -Jxvf dpkg-deb -x tar -jxvf
package -vid -vid
Query a
package
supplied on the
command line
rather than an pacman -Qp rpm -qp dpkg -I
entry in the
package
management
database
Action Arch Red Hat/Fedora Debian/Ubuntu SUSE/openSUSE Gentoo
See also
Changes in DNF CLI compared to Yum (http://dnf.readthedocs.org/en/latest/cli_vs_yum.html)