COMMANDS_LINUX

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

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

Basic operations
SLES/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Install a package(s) by zypper install


pacman -S dnf install apt install emerge [-a]
name zypper in

Remove a package(s) by zypper remove


pacman -Rs dnf remove apt remove emerge -C
name zypper rm

Search for package(s) by


searching the expression
in name, description, short
description. What exact zypper search
pacman -Ss dnf search apt search emerge -S
fields are being searched zypper se [-s]
by default varies in each
tool. Mostly options bring
tools on par.

Upgrade Packages - Install


packages which have an pacman - apt update && apt zypper update emerge -u
dnf upgrade
older version already Syu upgrade zypper up world
installed

Upgrade Packages -
Another form of the
update command, which
can perform more
complex updates -- like
distribution upgrades.
pacman - apt update && apt emerge -
When the usual update dnf distro-sync zypper dup
Syu dist-upgrade uDN world
command will omit
package updates, which
include changes in
dependencies, this
command can perform
those updates.

Clean up all local caches. pacman -Sc dnf clean all apt autoclean zypper clean eclean
Options might limit what
is actually cleaned.
pacman -
Autoclean removes only apt clean distfiles
Scc
unneeded, obsolete
information.

Remove dependencies that


are no longer needed, pacman -
because e.g. the package Qdtq | emerge --
dnf autoremove apt autoremove zypper rm -u
which needed the pacman -Rs depclean
dependencies was -
removed.

pacman -
Remove packages no
Qmq | package-cleanup
longer included in any aptitude purge '~o'
pacman -Rs --orphans
repositories.
-

Mark a package
previously installed as a pacman -D emerge --
dnf mark install apt-mark manual
dependency as explicitly --asexplicit select
required.

Install package(s) as
dependency / without pacman -S dnf install => dnf
apt-mark auto emerge -1
marking as explicitly --asdeps mark remove
required.

apt install --
download-only
Only downloads the given
(into the package
package(s) without zypper -- emerge --
pacman -Sw dnf download cache)
unpacking or installing download-only fetchonly
apt download
them
(bypass the
package cache)

Start a shell to enter


multiple commands in one apt-config shell zypper shell
session

Show a log of actions cat located in


cat /var/log/ cat
taken by the software dnf history /var/log/zypp/his /var/log/port
pacman.log /var/log/dpkg.log
management. tory age

Get a dump of the whole


system information -
(see /var/lib/
Prints, Saves or similar the (see /var/lib/rpm/ emerge --
pacman/loca apt-cache stats n/a
current state of the Packages) info
l)
package management
system. Preferred output is
text or XML. (Note: Why
either-or here? No tool
offers the option to choose
the output format.)

e-mail delivery of package apt install apt-


changes listchanges

SUSE/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Querying specific packages


Debian/ SLES/
Action Arch Red Hat/Fedora Gentoo
Ubuntu openSUSE

Show all or most information


about a package. The tools'
apt show / emerge -S;
verbosity for the default pacman zypper info
dnf list, dnf info apt-cache emerge -pv;
command vary. But with -[S|Q]i zypper if
policy eix
options, the tools are on par
with each other.

Display local package


pacman dpkg -s / zypper info; emerge -pv
information: Name, version, rpm -qi
-Qi aptitude show rpm -qi and emerge -S
description, etc.

emerge -pv
Display remote package apt-cache
pacman and emerge -S
information: Name, version, dnf info show / zypper info
-Si or equery m
description, etc. aptitude show
(meta)

Display files provided by local pacman


rpm -ql dpkg -L rpm -Ql equery files
package -Ql

dnf repoquery -l or
Display files provided by a pacman apt-file list
repoquery -l (from pfl
remote package -Fl $pattern
package yum-utils)

rpm -qf (installed


only) or dnf
Query the package which pacman provides dpkg -S / equery
zypper search -f
provides FILE -Qo (everything) or dlocate belongs
repoquery -f (from
package yum-utils)
List the files that the package pacman
holds. Again, this functionality -Ql dpkg-query -
dnf repoquery -l rpm -ql equery files
can be mimicked by other pacman L
more complex commands. -Fl

Displays packages which


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

Search all packages to find the


one which holds the specified pacman apt-file equery
dnf provides zypper search -f
file. auto-apt is using this -Fs search belongs
functionality.

Show the changelog of a pacman apt-get rpm -q -- equery


rpm -q --changelog
package -Qc changelog changelog changes -f

Debian/ SUSE/
Action Arch Red Hat/Fedora Gentoo
Ubuntu openSUSE

Querying package lists


SLES/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Search for package(s) by


searching the expression
in name, description, short
description. What exact pacman zypper search
dnf search apt search emerge -S
fields are being searched -Ss zypper se [-s]
by default varies in each
tool. Mostly options bring
tools on par.

Lists packages which have


an update available. Note:
zypper list-
Some provide special
pacman dnf list updates, apt-get upgrade updates zypper emerge -uDNp
commands to limit the
-Qu dnf check-update -> n patch-check (just world
output to certain
for patches)
installation sources, others
use options.

Display a list of all pacman dnf list available apt-cache zypper packages emerge -ep
packages in all installation -Sl dumpavail apt- world
sources that are handled cache dump
by the packages (Cache only)
management. Some tools
provide options or
additional commands to apt-cache
limit the output to a pkgnames
specific installation
source.

Generates a list of pacman dpkg --list | grep zypper search -- emerge -ep
dnf list installed
installed packages -Q ^i installed-only world

List packages that are


installed but are not zypper se -si |
pacman
available in any dnf list extras deborphan grep 'System eix-test-obsolete
-Qm
installation source Packages'
(anymore).

List packages that were


aptitude search
recently added to one of
(none) dnf list recent '~N' / aptitude n/a eix-diff
the installation sources,
forget-new
i.e. which are new to it.

List installed local


pacman zypper search -s;
packages along with rpm -qa dpkg -l emerge -e world
-Q rpm -qa
version

Search locally installed aptitude search


pacman
package for names or rpm -qa '*<str>*' '~i(~n $name|~d eix -S -I
-Qs
descriptions $description)'

List packages not required pacman package-cleanup


deborphan -anp1
by any other package -Qt --all --leaves

List packages installed


pacman dnf history apt-mark
explicitly (not as
-Qe userinstalled showmanual
dependencies)

List packages installed


pacman apt-mark
automatically (as
-Qd showauto
dependencies)

SUSE/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Querying package dependencies


SLES/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Display packages which pacman dnf repoquery -- apt-cache rdepends / zypper equery
alldeps --
require X to be installed, aka whatrequires or aptitude search search --
-Sii depends
show reverse dependencies. repoquery -- ~D$pattern requires
whatr[equires]

Display packages which


conflict with given
dnf repoquery -- aptitude search
expression (often package).
conflicts '~C$pattern'
Search can be used as well
to mimic this function.

List all packages which are


dnf repoquery --
required for the given pacman apt-cache depends / zypper info -- emerge -
requires or repoquery
package, aka show -[S|Q]i apt-cache show requires ep
-R
dependencies.

List what the current dpkg -s / aptitude zypper info -- equery


dnf provides
package provides show provides files

aptitude search
dnf repoquery -- ~D{depends,recomm zypper equery
List all packages that require
alldeps -- ends,suggests}: search -- depends -
a particular package
whatrequires $pattern / aptitude requires a
why

Display all packages that the


specified packages dnf list obsoletes apt-cache show
obsoletes.

Generates an output suitable


for processing with dotty for apt-cache dotty n/a
the given package(s).

SUSE/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE

Installation sources management


Red Debian/ SLES/
Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

${EDITOR} ${EDITOR} /
${EDITOR} / ${EDITOR}
Installation sources /etc/yum.repos. etc/zypp/repos
etc/pacman.co /etc/apt/sources layman
management d/$ .d/$
nf .list
{REPO}.repo {REPO}.repo

Add an installation /etc/ /etc/ apt-cdrom add zypper layman, overlays


source to the system. pacman.conf yum.repos.d/ service-add
Some tools provide
additional commands
for certain sources,
others allow all types
of source URI for the
add command. Again
others, like apt and
*.repo
dnf force editing a
sources list. apt-cdrom
is a special command,
which offers special
options design for
CDs/DVDs as source.

Refresh the pacman -Sy


dnf clean
information about the (always
expire-cache zypper refresh emerge --
specified installation upgrade the apt-get update
&& dnf check- zypper ref sync;layman -S
source(s) or all whole system
update
installation sources. afterwards)

Prints a list of all


installation sources cat cat
apt-cache zypper
including important /etc/pacman.d/ /etc/yum.repos. layman -l
policy service-list
information like URI, mirrorlist d/*
alias etc.

List all packages from


paclist <repo>
a certain repo

Disable an installation
dnf -- emerge
source for an
disablerepo= package::repo-to-use
operation

apt-get install -
echo
Download packages t release
"category/package
from a different package/ apt-
dnf -- ~amd64" >>
version of the get install
releasever= /etc/portage/package.
distribution than the package/releas
keywords &&
one installed. e (deps not
emerge package
covered)

Red Debian/ SUSE/


Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

Overrides
Red Debian/ SLES/
Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

Add a package lock /etc/ dnf.conf apt-mark Put package /etc/portage/


rule to keep its current pacman.conf <--”exclude” hold pkg name in
state from being modify option /etc/zypp/lock
package.mask
changed IgnorePkg array (add/amend) s, or zypper al

remove package Remove


from IgnorePkg package name /etc/portage/
Delete a package lock apt-mark
line in from package.mask (or
rule unhold pkg
/etc/pacman.con /etc/zypp/lock package.unmask)
f s or zypper rl

cat View cat


Show a listing of all /etc/apt/
/etc/pacman.con /etc/zypp/lock /etc/portage/package.
lock rules preferences
f s or zypper ll mask

Set the priority of the


given package to avoid
${EDITOR}
upgrade, force ${EDITOR}
/etc/pacman.con
downgrade or to /etc/apt/ /etc/portage/package.
f
overwrite any default preferences, keywords
Modify zypper mr -p
behavior. Can also be apt-cache Add a line with
HoldPkg and/or
used to prefer a policy =category/package-
IgnorePkg
package version from a version
arrays
certain installation
source.

${EDITOR}
/etc/portage/package.
Remove a previously /etc/apt/
zypper mr -p keywords
set priority preferences
remove offending
line

apt-cache
cat
Show a list of set policy
zypper lr -p /etc/portage/package.
priorities. /etc/apt/prefer
keywords
ences

Ignores problems that


n/a
priorities may trigger.

Red Debian/ SUSE/


Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

Verification and repair


Red Debian/ SLES/
Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

Verify single package pacman -Qk[k] rpm -V debsums rpm -V equery check
Verify all packages pacman -Qk[k] rpm -Va debsums rpm -Va equery check

Reinstall given
Package - Will zypper
apt install --
reinstall the given pacman -S dnf reinstall install -- emerge -1O
reinstall
package without force
dependency hassle.

Verify dependencies
of the complete
dnf repoquery -- apt-get zypper emerge -uDN
system. Used if pacman -Dk
requires check verify world
installation process
was forcefully killed.

pacman dep level - apt-get --fix-


Use some magic to fix
pacman -Dk, shared lib dnf repoquery -- broken zypper
broken dependencies revdep-rebuild
level - findbrokenpkgs unsatisfied aptitude verify
in a system
or lddd install

Add a checkpoint to (unnecessary,


the package system done on every n/a
for later rollback transaction)

Remove a checkpoint
N/A N/A n/a
from the system

Provide a list of all


N/A dnf history list n/a
system checkpoints

Rolls entire packages


dnf history
back to a certain date N/A n/a
rollback
or checkpoint.

Undo a single
N/A dnf history undo n/a
specified transaction.

Red Debian/ SUSE/


Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE

Using package files and building packages


Red
Debian/ SLES/
Action Arch Hat/Fedor Gentoo
Ubuntu openSUSE
a

Query a package supplied on pacman -Qp rpm -qp dpkg -I


the command line rather than
an entry in the package
management database

List the contents of a package rpmls rpm -


pacman -Qpl dpkg -c rpm -qpl
file qpl

Installs local package file, e.g.


app.rpm and uses the
pacman -U dnf install apt install zypper in emerge
installation sources to resolve
dependencies

Updates package(s) with local


packages and uses the dnf
pacman -U debi emerge
installation sources to resolve upgrade
dependencies

cp
Add a local package to the cp $filename
$filename
local package cache mostly /var/cache/pacm apt-cache add n/a
/usr/portage/d
for debugging purposes. an/pkg/
istfiles

rpm2cpio | rpm2cpio |
Extract a package tar -Jxvf dpkg-deb -x tar -jxvf
cpio -vid cpio -vid

Install/Remove packages to
satisfy build-dependencies. dnf apt-get build-
automatic zypper si -d emerge -o
Uses information in the builddep dep
source package.

dnf
Display the source package to apt-cache
repoquery - n/a
the given package name(s) showsrc
s

Downloads the corresponding dnf


Use ABS && apt-get source / zypper source- emerge --
source package(s) to the given download
makepkg -o debcheckout install fetchonly
package name(s) --source

rpmbuild -
rpmbuild -ba;
ba (normal) ebuild;
Build a package makepkg -s debuild build; osc
mock (in quickpkg
build
chroot)

Check for possible packaging


namcap rpmlint lintian rpmlint repoman
issues

Red
Debian/ SUSE/
Action Arch Hat/Fedor Gentoo
Ubuntu openSUSE
a

You might also like