0% found this document useful (0 votes)
71 views16 pages

Unix Package Managers

This document summarizes common package management operations and commands across different Linux distributions, including Arch/Manjaro, Red Hat/Fedora, Debian/Ubuntu, SLES/openSUSE, and Gentoo. It outlines the typical commands used to install, remove, search for, upgrade, clean, and query packages in each distribution. The table also lists commands for viewing package information, files, and dependencies.

Uploaded by

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

Unix Package Managers

This document summarizes common package management operations and commands across different Linux distributions, including Arch/Manjaro, Red Hat/Fedora, Debian/Ubuntu, SLES/openSUSE, and Gentoo. It outlines the typical commands used to install, remove, search for, upgrade, clean, and query packages in each distribution. The table also lists commands for viewing package information, files, and dependencies.

Uploaded by

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

Unix - Package managers

Basic operations
Arch/ SLES/
Action Red Hat/Fedora Debian/Ubuntu Gentoo
Manjaro openSUSE
Install a zypper
package(s) by pacman -S dnf install apt install install or emerge [-a]
name zypper in
Remove a zypper
emerge -
package(s) by pacman -Rs dnf remove apt remove remove or
[a]vc
name zypper rm
Search for
package(s) by
searching the
expression in
name,
description,
short zypper
description. search or
pacman -Ss dnf search apt search emerge -S
What exact zypper se
fields are being [-s]
searched by
default varies in
each tool.
Mostly options
bring tools on
par.
Upgrade
Packages - zypper emerge -
apt update
Install packages pacman -Syu dnf upgrade and then apt [a]uDN
update or
which have an
upgrade zypper up @world
older version
already installed
Upgrade pacman -Syu dnf distro- apt update zypper dup emerge -
Packages - sync and then apt [a]uDN
Another form of dist- @world
the update upgrade
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.
apt
Clean up all
autoclean
local caches. pacman -Sc removes only
Options might dnf clean zypper eclean
or pacman - all unneeded, clean
limit what is distfiles
Scc obsolete
actually
information or
cleaned.
apt clean
zypper rm -
Remove u (just for
dependencies
removing a
that are no
pacman - package) or
longer needed, Qdtq | dnf apt zypper emerge [-a]
because e.g. the pacman -Rs autoremove autoremove packages -- --depclean
package which - unneeded
needed the
(listing only and
dependencies
without
was removed.
recursion)
Remove
packages no pacman -Qmq dnf
aptitude
longer included | pacman - repoquery purge '~o'
in any Rs - --extras
repositories.
zypper
Mark a package install --
previously pacman -D force
installed as a dnf mark apt-mark emerge --
-- (workaround
dependency as asexplicit install manual select
which needs to
explicitly
reinstall the
required.
package)
Install
package(s) as emerge [-a]
dependency / dnf install
pacman -S apt-mark n/a (feature --oneshot or
without --asdeps and then dnf auto emerge [-a]
request)
marking as mark remove
-1
explicitly
required.
apt install
Only downloads --download-
the given only (into the
zypper --
package(s) dnf package cache) emerge [-a]
pacman -Sw download-
without download or apt --fetchonly
only
unpacking or download
installing them (bypass the
package cache)
Start a shell to
enter multiple apt-config zypper
dnf shell
commands in shell shell
one session
Show a log of
read read read read
actions taken by /var/log/pa dnf history /var/log/dp /var/log/zy /var/log/po
the software cman.log kg.log pp/history rtage
management.
Get a dump of
the whole
system
information -
Prints, Saves or
similar the
current state of
the package
see see apt-cache emerge --
management /var/lib/pa /var/lib/rp
system. stats info
cman/local m/Packages
Preferred output
is text or XML.
(Note: Why
either-or here?
No tool offers
the option to
choose the
output format.)
e-mail delivery apt install
of package apt-
changes listchanges

Querying specific packages


Red Debian/ SLES/
Action Arch Gentoo
Hat/Fedora Ubuntu openSUSE
Show all or most
information about
a package. The
tools' verbosity for pacman -
apt show or zypper emerge -S,
the default Si or dnf list or
apt-cache info or emerge -pv
command vary. pacman - dnf info
policy zypper if or eix
But with options, Qi
the tools are on
par with each
other.
Display local
package rpm -qi / dpkg -s or zypper emerge -pv
pacman -
information: dnf info aptitude info or rpm or emerge -
Qi
Name, version, installed show -qi S
description, etc.
Display remote pacman - dnf info apt-cache zypper emerge -pv
package and emerge
show or
information: Si info
aptitude -S or equery
Name, version,
show meta
description, etc.
Display files equery
pacman -
provided by local Ql rpm -ql dpkg -L rpm -ql files or
package qlist
dnf
repoquery
Display files -l or
pacman - apt-file
provided by a repoquery pfl
Fl list
remote package -l (from
package yum-
utils)
rpm -qf
(installed only)
or dnf
Query the package pacman - provides equery
dpkg -S or zypper
which provides (everything) or belongs or
Qo dlocate search -f
FILE repoquery qfile
-f (from
package yum-
utils)
List the files that
the package holds.
Again, this pacman -
dnf equery
functionality can Ql or dpkg-query
repoquery rpm -ql files or
be mimicked by pacman - -l -L
qlist
other more Fl
complex
commands.
Displays packages
which provide the
given exp. aka
reverse provides. equery
zypper
Mainly a shortcut pacman - dnf belongs
apt-file what-
to search a specific F provides search (only installed
provides or
field. Other tools packages) or
zypper wp
might offer this pfl
functionality
through the search
command.
Search all apt-file
packages to find pacman - dnf search or equery
zypper
the one which auto-apt is search -f belongs or
F provides
holds the specified using this qfile
file. functionality.
Show the pacman - dnf apt-get rpm -q -- equery
changelog of a Qc changelog changelog changelog changes -f
package
Querying package lists
Action Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
Search for
package(s
) by
searching
the
expressio
n in name,
descriptio
n, short
descriptio
n. What zypper
pacman emerge -S or
exact dnf search apt search search or
-Ss eix
fields are zypper se -s
being
searched
by default
varies in
each tool.
Mostly
options
bring
tools on
par.
Lists
packages
which
have an
update
available.
Note: zypper list-
Some dnf list updates or
provide pacman apt list -- emerge -uDNp
updates or dnf zypper
special -Qu upgradable @world
check-update patch-check
command
(just for patches)
s to limit
the output
to certain
installatio
n sources,
others use
options.
Display a pacman dnf list apt-cache zypper portageq
list of all -Sl available dumpavail or packages all_best_vis
packages apt-cache ible /
in all dump (Cache
installatio only) or apt-
n sources cache
that are pkgnames
handled
by the
packages
managem
ent. Some
tools
provide
options or
additional
command
s to limit
the output
to a
specific
installatio
n source.
Generates zypper
a list of pacman dnf list dpkg --list search --
qlist -IC
installed -Q installed | grep ^i installed-
packages only
List
packages
that are
installed
but are apt -- zypper se -
not pacman dnf list installed si | grep eix-test-
available -Qm extras list | 'System obsolete
in any grep ,local Packages'
installatio
n source
(anymore)
.
List
packages
that were
recently aptitude
added to dnf list search '~N' or
one of the eix-diff
recent aptitude
installatio
forget-new
n sources,
i.e. which
are new to
it.
List
installed
dpkg -l or apt zypper
local pacman
rpm -qa list -- search -s or qlist -ICv
packages -Q
installed rpm -qa
along with
version
Search pacman rpm -qa aptitude eix -S -I
locally -Qs '*<str>*' search
installed '~i(~n
package
for names $name|~d
or $description
descriptio )'
ns
List
packages
dnf leaves or
not pacman package- deborphan -
required emerge -pc
-Qtt cleanup -- anp1
by any
leaves --all
other
package
List
packages emerge -pvO
installed dnf history
pacman apt-mark grep -E '^i\+' @selected or
explicitly userinstalle
-Qe showmanual (workaround) eix --
(not as d
selected
dependen
cies)
List
packages
installed pacman grep -E '^i[^+]' apt-mark
automatic -Qd showauto
(workaround)
ally (as
dependen
cies)

Querying package dependencies


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

Installation sources management


Acti
Arch Red Hat/Fedora Debian/Ubuntu SLES/openSUSE Gentoo
on
Inst
allat
ion
edit edit layman or
sour edit /etc/yum.rep edit /etc/zypp/re
ces /etc/pacman /etc/apt/sou eselect
os.d/$ pos.d/$
man .conf {REPO}.repo
rces.list
{REPO}.repo repository
age
men
t
Add edit /etc/ apt-cdrom zypper layman or
an /etc/pacman yum.repos.d/ add service-add overlays
insta .conf *.repo
llati
on
sour
ce
to
the
syst
em.
Som
e
tool
s
prov
ide
addi
tion
al
com
man
ds
for
cert
ain
sour
ces,
othe
rs
allo
w
all
type
s of
sour
ce
URI
for
the
add
com
man
d.
Aga
in
othe
rs,
like
apt
and
dnf
forc
e
editi
ng a
sour
ces
list.
apt-
cdro
m is
a
spec
ial
com
man
d,
whi
ch
offe
rs
spec
ial
opti
ons
desi
gn
for
CDs
/DV
Ds
as
sour
ce.
Refr
esh
the
info
rmat
ion
abo
ut pacman -Sy dnf clean
the (always upgrade zypper emerge --
expire-cache apt-get
spec the whole refresh or sync or layman
and then dnf update
ified system zypper ref -S
check-update
insta afterwards)
llati
on
sour
ce(s
) or
all
insta
llati
on
sour
ces.
Prin
ts a
list
of
all
insta
llati
on
sour
ces
incl cat layman -l or
cat
udin /etc/pacman /etc/yum.rep
apt-cache zypper eselect
g .d/mirrorli policy service-list repository
os.d/*
imp st list
orta
nt
info
rmat
ion
like
URI
,
alias
etc.
List
all
pack
ages paclist eix --in-
fro <repo>
overlay
ma
cert
ain
repo
Disa
ble
an
insta
llati
on emerge
dnf --
sour package::rep
disablerepo=
ce o-to-use
for
an
oper
atio
n
Do dnf -- apt-get echo
wnl
oad
pack
ages
fro
ma install -t "category/pa
diffe release ckage
rent ~amd64"
package or
vers apt-get >>
ion releasever= install /etc/portage
of package/rele /package.key
the words and then
ase
distr emerge
(dependencies not
ibuti
covered) package
on
than
the
one
insta
lled.

Overrides
Red SLES/
Action Arch Debian/Ubuntu Gentoo
Hat/Fedora openSUSE
Add a edit zypper
package edit
dnf.conf al or put
lock rule to /etc/pacman
adding/ame apt-mark package /etc/portage/
keep its .conf
nding the hold pkg name in package.mask
current state modifying
exclude /etc/zyp
from being IgnorePkg array
option p/locks
changed
zypper
edit
/etc/pacman rl or
Delete a remove /etc/portage/
.conf apt-mark
package package.mask (or
removing unhold pkg package
lock rule name from package.unmask)
package from /etc/zyp
IgnorePkg line p/locks
zypper
Show a cat cat
/etc/apt/ ll or view
listing of all /etc/pacman /etc/portage/pa
preferences /etc/zyp
lock rules .conf ckage.mask
p/locks
Set the edit /etc/apt/ zypper edit
priority of /etc/pacman preferences, mr -p /etc/portage/pa
the given .conf apt-cache ckage.accept_ke
package to modifying policy ywords adding a line
avoid HoldPkg and/or with
upgrade, IgnorePkg arrays =category/packa
force ge-version
downgrade
or to
overwrite
any default
behavior.
Can also be
used to
prefer a
package
version from
a certain
installation
source.
edit
Remove a /etc/portage/pa
/etc/apt/ zypper
previously ckage.accept_ke
preferences mr -p
set priority ywords removing
offending line
apt-cache grep -r .
Show a list zypper /etc/portage/pa
policy or
of set ckage.accept_ke
/etc/apt/pr lr -p
priorities
eferences ywords
Ignore
problems
that n/a
priorities
may trigger.

Verification and repair


SLES/
Action Arch Red Hat/Fedora Debian/Ubuntu Gentoo
openSUSE
Verify single pacman -Qk rpm -V debsums rpm -V equery check
package (can add another k)
Verify all pacman -Qk
rpm -Va debsums rpm -Va equery check
packages (can add another k)
Reinstall
given
package; this
will reinstall zypper
apt install
the given pacman -S dnf reinstall install emerge -1O
--reinstall
package --force
without
dependency
hassle
Verify pacman -Dk dnf repoquery apt-get zypper emerge -uDN
dependencies --requires check verify @world
of the
complete
system; used
if installation
process was
forcefully
killed
for pacman
dependency level,
Use some apt-get --
use pacman -
magic to fix fix-broken
Dk; for shared dnf repoquery zypper
broken and then revdep-rebuild
library level, use --unsatisfied aptitude
verify
dependencies
findbrokenpkgsAUR install
in a system
or lddd (from
devtools)
Add a
checkpoint to (unnecessary, it is
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 dnf history
of all system n/a list n/a
checkpoints
Rolls entire
packages dnf history
back to a n/a rollback n/a
certain date
or checkpoint
Undo a single dnf history
specified n/a undo n/a
transaction

Using package files and building packages


Action
Query a package supplied on the command line rather than an entry in the package management
database
List the contents of a package file
Install local package file, e.g. app.rpm and uses the installation sources to resolve dependencies
Updates package(s) with local packages and uses the installation sources to resolve dependencies
Add a local package to the local package cache mostly for debugging purposes.
Extract a package
Install/Remove packages to satisfy build-dependencies. Uses information in the source package
Display the source package to the given package name(s)
Download the corresponding source package(s) to the given package name(s)
Build a package
Check for possible packaging issues
Log file rotation
By default, Arch Linux does not rotate pacman.log. See, for example, FS#11272 and
FS#20428#comment66480. This is in contrast to the default policy of most other Linux
distributions. Some distributions, notably Gentoo, hardly write log files by default.

See below more

bmenu. It's a custom manjaro command line menu, which commands shortcuts for a lot of useful
stuff. It lets you
• manage packages interactively with pacui
• manage files with ranger or mc
• manage systemd services (it does support openrc too, but manjaro no longer does)
• manage kernels and drivers with mhwd-tui
• manage monitors with brandr (not good for persistent settings)
• manage printers with bcups (very flaky)
• search and open files with fzf
• set fonts, gtk themes and icons
• configure touchpad (not good for persistent settings)
• enable hibernation autostart and other stuff

mount. Mounts volumes to specific mount points. Needed for chrooting

• manjaro-chroot. Easily chroot into a broken system to fix it


• mkinitcpio -P and update-grub. Needed after interrupted kernel update before
rebooting to avoid broken system. Run in chroot if your system doesn't boot.
Show a list of your disks and partitions
lsblk
Show all your mounted partitions, how much space is used and how much is free:
df -h
Create symbolic link:
ln -s <source> <target>
Shutdown the system:
systemctl poweroff
Reboot:
systemctl reboot
List all the potential systemd unit files:(useful when you want to enable one but you can't remember
the exact name)
systemctl list-unit-files
Start/stop/enable/disable a service:
systemctl start|stop|enable|disable <service>
Get information about a command:
which <command>
Get help on the usage of a command:
man <command>
Dump the contents of a file to the screen:
cat <filename>
Run a command as root or another user:
sudo <command>

You might also like