Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
152 views10 pages

Super Cow Powers

This document summarizes common package management operations across different Linux distributions and package managers. It lists the commands to install, remove, update, and search for packages in distributions like Arch Linux, Red Hat/Fedora, Debian/Ubuntu, openSUSE, and Gentoo. It also provides the commands to query specific packages to show information, files, dependencies, and which package provides a given file.

Uploaded by

yaken ossumma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views10 pages

Super Cow Powers

This document summarizes common package management operations across different Linux distributions and package managers. It lists the commands to install, remove, update, and search for packages in distributions like Arch Linux, Red Hat/Fedora, Debian/Ubuntu, openSUSE, and Gentoo. It also provides the commands to query specific packages to show information, files, dependencies, and which package provides a given file.

Uploaded by

yaken ossumma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Basic operations

SLES/openSUS
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
E
Install a package(s) zypper install
pacman -S dnf install apt install emerge [-a]
by name zypper in
Remove a package(s) zypper remove
pacman -Rs dnf remove apt autoremove emerge -C
by name zypper rm
Search for
package(s) by
searching the
expression in name,
description, short
zypper search
description. What pacman -Ss dnf search apt search emerge -S
zypper se [-s]
exact fields are being
searched by default
varies in each tool.
Mostly options bring
tools on par.
Upgrade Packages -
Install packages
pacman apt update; apt zypper update emerge -u
which have an older dnf upgrade
-Syu upgrade zypper up world
version already
installed
Upgrade Packages -
Another form of the
update command,
which can perform
more complex
updates -- like
distribution
upgrades. When the
pacman emerge
usual update dnf distro-sync apt full-upgrade zypper dup
-Syu -uDN world
command will omit
package updates,
which include
changes in
dependencies, this
command can
perform those
updates.
Clean up all local pacman -Sc dnf clean all apt-get clean / zypper clean eclean
caches. Options pacman apt-get distfiles
might limit what is -Scc autoclean /
actually cleaned. aptitude clean
Autoclean removes
only unneeded,
obsolete information.
Remove
dependencies that are
no longer needed, pacman
because e.g. the -Qdtq | apt-get emerge
dnf autoremove zypper rm -u
package which pacman -Rs autoremove --depclean
needed the -
dependencies was
removed.
pacman
Remove packages no
-Qm | package-cleanup aptitude purge
longer included in
pacman -Rs --orphans '~o'
any repositories.
-
Mark a package
previously installed pacman -D emerge
dnf mark install apt-mark manual
as a dependency as --asexplicit --select
explicitly required.
Install package(s) as
dependency / without pacman -S dnf install => dnf aptitude install
emerge -1
marking as explicitly --asdeps mark remove '$package&M'
required.
apt-get install
--download-only
Only downloads the
(into the package
given package(s) zypper emerge
pacman -Sw dnf download cache)
without unpacking or --download-only --fetchonly
apt-get download
installing them
(bypass the
package cache)
Start a shell to enter
multiple commands apt-config shell zypper shell
in one session
Show a log of actions cat cat located in
cat
taken by the software /var/log/pac dnf history /var/log/zypp/his /var/log/port
/var/log/dpkg.log
management. man.log tory age
Get a dump of the (see (see apt-cache stats n/a emerge
whole system /var/lib/pac /var/lib/rpm/Pack --info
information - Prints, man/local) ages)
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.)
e-mail delivery of apt-get install apt-
package changes listchanges
SUSE/openSUS
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
E

Querying specific packages


Red Debian/Ubu SLES/openSUS
Action Arch Gentoo
Hat/Fedora ntu E
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 dpkg -s / emerge -pv
pacman zypper info;
information: Name, version, rpm -qi aptitude and emerge
-Qi rpm -qi
description, etc. show -S
apt-cache
Display remote package emerge -pv
pacman show /
information: Name, version, dnf info zypper info and emerge
-Si aptitude
description, etc. -S
show
Display files provided by pacman
rpm -ql dpkg -L rpm -Ql equery files
local package -Ql
Display files provided by a pkgfile apt-file list
dnf repoquery -l pfl
remote package -l $pattern
rpm -qf
Query the package which pacman (installed only) dpkg -S / equery
zypper search -f
provides FILE -Qo or dnf provides dlocate belongs
(everything)
List the files that the package
pacman
holds. Again, this
-Ql dpkg-query
functionality can be dnf repoquery -l rpm -ql equery files
pkgfile -L
mimicked by other more
-l
complex commands.
Displays packages which
provide the given exp. aka
equery
reverse provides. Mainly a zypper what-
apt-file belongs (only
shortcut to search a specific pkgfile dnf provides provides zypper
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 pkgfile apt-file equery
dnf provides zypper search -f
specified file. auto-apt is -s search belongs
using this functionality.
Show the changelog of a pacman rpm -q apt-get rpm -q equery
package -Qc --changelog changelog --changelog changes -f
Red Debian/Ubu SUSE/openSU
Action Arch Gentoo
Hat/Fedora ntu SE

Querying package lists


Debian/Ubunt SLES/openSUS
Action Arch Red Hat/Fedora Gentoo
u E
Search for package(s)
by searching the
expression in name,
description, short
description. What pacman zypper search
dnf search apt search emerge -S
exact fields are being -Ss zypper se [-s]
searched by default
varies in each tool.
Mostly options bring
tools on par.
Lists packages which
have an update
available. Note: Some zypper list-
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
packages in all
installation sources
apt-cache
that are handled by
dumpavail apt-
the packages
pacman cache dump
management. Some dnf list available zypper packages emerge -ep world
-Sl (Cache only)
tools provide options
apt-cache
or additional
pkgnames
commands to limit the
output to a specific
installation source.
Generates a list of pacman dpkg --list | zypper search
dnf list installed emerge -ep world
installed packages -Q grep ^i --installed-only
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 (none) dnf list recent aptitude search n/a eix-diff
were recently added '~N' / aptitude
to one of 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
aptitude search
Search locally
pacman '~i(~n $name|
installed package for rpm -qa '*<str>*' eix -S -I
-Qs ~d
names or descriptions
$description)'
List packages not
pacman package-cleanup deborphan
required by any other
-Qt --all --leaves -anp1
package
List packages
pacman apt-mark
installed explicitly
-Qe showmanual
(not as dependencies)
List packages
installed pacman apt-mark
automatically (as -Qd showauto
dependencies)
Debian/Ubunt SUSE/openSUS
Action Arch Red Hat/Fedora Gentoo
u E

Querying package dependencies


SLES/openS
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
USE
Display packages which
dnf repoquery apt-cache rdepends / zypper
require X to be installed, pacman equery
--alldeps aptitude search search
aka show reverse -Sii depends
--whatrequires ~D$pattern --requires
dependencies.
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
required for the given pacman dnf repoquery apt-cache depends / zypper info emerge
package, aka show -[S|Q]i --requires apt-cache show --requires -ep
dependencies.
List what the current dpkg -s / aptitude zypper info equery
dnf provides
package provides show --provides files
List all packages that dnf repoquery aptitude search zypper equery
require a particular --alldeps ~D{depends,recomm search depends
package --whatrequires ends,suggests}: --requires -a
$pattern / aptitude
why
Display all packages that
the specified packages dnf list obsoletes apt-cache show
obsoletes.
Generates an output
suitable for processing with
apt-cache dotty n/a
dotty for the given
package(s).
SUSE/openS
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
USE

Installation sources management


Red Debian/Ubun SLES/openS
Action Arch Gentoo
Hat/Fedora tu USE
$
$ ${EDITOR} $
{EDITOR}
Installation sources {EDITOR} /etc/yum.repos. {EDITOR}
/etc/zypp/rep layman
management /etc/pacman.c d/$ /etc/apt/source
os.d/$
onf {REPO}.repo s.list
{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 / /
zypper
command. Again etc/pacman.co etc/yum.repos.d apt-cdrom add layman, overlays
service-add
others, like apt and nf /*.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
information about dnf clean
(always zypper
the specified expire-cache emerge
upgrade the apt-get update refresh
installation && dnf check- --sync;layman -S
whole system zypper ref
source(s) or all update
afterwards)
installation sources.
Prints a list of all cat cat apt-cache zypper layman -l
installation sources
including important /etc/pacman.d /etc/yum.repos.
policy service-list
information like /mirrorlist d/*
URI, alias etc.
Disable an
dnf emerge
installation source
--disablerepo= package::repo-to-use
for an operation
apt-get install
Download echo
-t release
packages from a "category/package
package/ apt-
different version of dnf ~amd64" >>
get install
the distribution --releasever= /etc/portage/package
package/releas
than the one .keywords &&
e (deps not
installed. emerge package
covered)
Red Debian/Ubun SUSE/openS
Action Arch Gentoo
Hat/Fedora tu USE

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

Verification and repair


Red Debian/Ubu SLES/open
Action Arch Gentoo
Hat/Fedora ntu SUSE
Verify single
pacman -Qk[k] rpm -V debsums rpm -V equery check
package
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 [-a]
--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 -
Use some magic to apt-get --fix-
pacman -Dk, shared
fix broken dnf repoquery broken zypper
lib level - revdep-rebuild
dependencies in a --unsatisfied aptitude verify
findbrokenpkgs or
system install
lddd
Add a checkpoint
(unnecessary,
to the package
done on every n/a
system for later
transaction)
rollback
Remove a
checkpoint from N/A N/A n/a
the system
Provide a list of all
N/A dnf history list n/a
system checkpoints
Rolls entire
packages back to a dnf history
N/A n/a
certain date or rollback
checkpoint.
Undo a single
dnf history
specified N/A n/a
undo
transaction.
Red Debian/Ubu SUSE/open
Action Arch Gentoo
Hat/Fedora ntu SUSE

Using package files and building packages


Red
Debian/Ubunt SLES/openSU
Action Arch Hat/Fedor Gentoo
u SE
a
Query a package supplied
on the command line
rather than an entry in the pacman -Qp rpm -qp dpkg -I
package management
database
List the contents of a rpmls rpm
pacman -Qpl dpkg -c rpm -qpl
package 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 dnf
pacman -U debi emerge
the installation sources to upgrade
resolve dependencies
Add a local package to the
cp $filename cp $filename
local package cache
/var/cache/pac apt-cache add n/a /usr/portage/
mostly for debugging
man/pkg/ distfiles
purposes.
rpm2cpio | rpm2cpio |
Extract a package tar -Jxvf dpkg-deb -x tar -jxvf
cpio -vid cpio -vid
Install/Remove packages
to satisfy build-
dnf apt-get build-
dependencies. Uses automatic zypper si -d emerge -o
builddep dep
information in the source
package.
Display the source dnf
apt-cache
package to the given repoquery n/a
showsrc
package name(s) -s
Downloads the
dnf
corresponding source Use ABS && apt-get source / zypper source- emerge
download
package(s) to the given makepkg -o debcheckout install --fetchonly
--source
package name(s)
rpmbuild
-ba rpmbuild -ba;
ebuild;
Build a package makepkg -s (normal) debuild build; osc
quickpkg
mock (in build
chroot)
Check for possible
namcap rpmlint lintian rpmlint repoman
packaging issues
Red
Debian/Ubunt SUSE/openS
Action Arch Hat/Fedor Gentoo
u USE
a

You might also like