Cross reference table for package management (apt pacman emerge — debian arch gentoo)

For arch, debian, gentoo, users who want to try one of the other two distributions or their derivatives, one of the obstacles is package management.  It is the primary thing among linux distributions that differs and when a user has become accustomed to one, the other will just not do. You frequently hear “arch is wonderful but pacman is a pain in ….”, or “debian is great but I just can’t stand apt”.   And everyone hates emerge.  In a way they can all do what the others do just that the format of the commands and the procedures behind the commands differ.  After all, whether binary or code, you download it, or copy it from somewhere, then you compile it if it is not already compiled, then install it and its dependent files in the appropriate locations in the system.

Arch wiki has a great table and article on this specific subject, Pacman/Rosetta it only incorporates RH and OpenSuse, which we don’t want to reproduce here.  We edited the table to make it more specific on those three systems, debian (based as in Refracta, Antix, MX, Devuan, etc), arch (based, artix, obarun, hyperbola, archbang), and Gentoo (redcore, CloverOS, etc).

As it is very hard (maybe impossible) to format something like this for wordpress you can copy paste the following table into a rich document editor or spreadsheet (gnumeric is my favorite, especially the gnome-free version found in AUR) to keep locally.  I could post a gnumeric or .odt file here for you to download but people generally hate downloading files with active code or binaries.  Even though they do it all day browsing the web.

Copy the following and pasting it on a spreadsheet at A1 cell would work well.  If you have never used gnumeric, give it a try.  It is almost like old excel used to be (it was never good and horrible with large tables of data) and a lot less convoluted than Open/Libre-office tools.  It can even import and export in dbase format for those old enough to remember.

Basic operations Basic operations
Arch Debian/Ubuntu Gentoo Action
pacman -S apt install emerge [-a] Install a package(s) by name
pacman -Rs apt remove emerge -C Remove a package(s) by name
pacman -Ss apt search emerge -S Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.
pacman -Syu apt update && apt upgrade emerge -u world Upgrade Packages – Install packages which have an older version already installed
pacman -Syu apt update && apt dist-upgrade emerge -uDN world Upgrade Packages – Another form of the update 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.
pacman -Sc apt autoclean eclean distfiles Clean up all local caches. Options might limit what is actually cleaned. Autoclean removes only unneeded, obsolete information.
pacman -Scc apt clean
pacman -Qdtq | pacman -Rs – apt autoremove emerge –depclean Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.
pacman -Qmq | pacman -Rs – aptitude purge ‘~o’ Remove packages no longer included in any repositories.
pacman -D –asexplicit apt-mark manual emerge –select Mark a package previously installed as a dependency as explicitly required.
pacman -S –asdeps apt-mark auto emerge -1 Install package(s) as dependency / without marking as explicitly required.
pacman -Sw apt install –download-only (into the package cache) emerge –fetchonly Only downloads the given package(s) without unpacking or installing them
apt download (bypass the package cache)
apt-config shell Start a shell to enter multiple commands in one session
cat /var/log/pacman.log cat /var/log/dpkg.log located in /var/log/portage Show a log of actions taken by the software management.
(see /var/lib/pacman/local) apt-cache stats emerge –info Get a dump of the whole system information – Prints, 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.)
apt install apt-listchanges e-mail delivery of package changes
Querying specific packages Querying specific packages
pacman -[S|Q]i apt show / apt-cache policy emerge -S; emerge -pv; eix Show all or most information about a package. The tools’ verbosity for the default command vary. But with options, the tools are on par with each other.
pacman -Qi dpkg -s / aptitude show emerge -pv and emerge -S Display local package information: Name, version, description, etc.
pacman -Si apt-cache show / aptitude show emerge -pv and emerge -S or equery m (meta) Display remote package information: Name, version, description, etc.
pacman -Ql dpkg -L equery files Display files provided by local package
pacman -Fl apt-file list $pattern pfl Display files provided by a remote package
pacman -Qo dpkg -S / dlocate equery belongs Query the package which provides FILE
pacman -Ql dpkg-query -L equery files List the files that the package holds. Again, this functionality can be mimicked by other more complex commands.
pacman -Fl
pacman -Fo apt-file search equery belongs (only installed packages); pfl Displays packages which provide the given exp. aka reverse provides. Mainly a shortcut to search a specific field. Other tools might offer this functionality through the search command.
pacman -Fs apt-file search equery belongs Search all packages to find the one which holds the specified file. auto-apt is using this functionality.
pacman -Qc apt-get changelog equery changes -f Show the changelog of a package
Querying package lists Querying package lists
pacman -Ss apt search emerge -S Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.
pacman -Qu apt-get upgrade -> n emerge -uDNp world Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options.
pacman -Sl apt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnames emerge -ep world Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source.
pacman -Q dpkg –list | grep ^i emerge -ep world Generates a list of installed packages
pacman -Qm deborphan eix-test-obsolete List packages that are installed but are not available in any installation source (anymore).
(none) aptitude search ‘~N’ / aptitude forget-new eix-diff List packages that were recently added to one of the installation sources, i.e. which are new to it.
pacman -Q dpkg -l emerge -e world List installed local packages along with version
pacman -Qs aptitude search ‘~i(~n $name|~d $description)’ eix -S -I Search locally installed package for names or descriptions
pacman -Qt deborphan -anp1 List packages not required by any other package
pacman -Qe apt-mark showmanual List packages installed explicitly (not as dependencies)
pacman -Qd apt-mark showauto List packages installed automatically (as dependencies)
Querying package dependencies Querying package dependencies
pacman -Sii apt-cache rdepends / aptitude search ~D$pattern equery depends Display packages which require X to be installed, aka show reverse dependencies.
aptitude search ‘~C$pattern’ Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.
pacman -[S|Q]i apt-cache depends / apt-cache show emerge -ep List all packages which are required for the given package, aka show dependencies.
dpkg -s / aptitude show equery files List what the current package provides
aptitude search ~D{depends,recommends,suggests}:$pattern / aptitude why equery depends -a List all packages that require a particular package
apt-cache show Display all packages that the specified packages obsoletes.
apt-cache dotty Generates an output suitable for processing with dotty for the given package(s).
Installation sources management Installation sources management
${EDITOR} /etc/pacman.conf ${EDITOR} /etc/apt/sources.list layman Installation sources management
/etc/pacman.conf apt-cdrom add layman, overlays 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. 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.
pacman -Sy (always upgrade the whole system afterwards) apt-get update emerge –sync;layman -S Refresh the information about the specified installation source(s) or all installation sources.
cat /etc/pacman.d/mirrorlist apt-cache policy layman -l Prints a list of all installation sources including important information like URI, alias etc.
paclist <repo> List all packages from a certain repo
emerge package::repo-to-use Disable an installation source for an operation
apt-get install -t release package/ apt-get install package/release (deps not covered) echo “category/package ~amd64” >> /etc/portage/package.keywords && emerge package Download packages from a different version of the distribution than the one installed.
Overrides Overrides
/etc/pacman.conf apt-mark hold pkg /etc/portage/package.mask Add a package lock rule to keep its current state from being changed
modify IgnorePkg array
remove package from IgnorePkg line in /etc/pacman.conf apt-mark unhold pkg /etc/portage/package.mask (or package.unmask) Delete a package lock rule
cat /etc/pacman.conf /etc/apt/preferences cat /etc/portage/package.mask Show a listing of all lock rules
${EDITOR} /etc/pacman.conf /etc/apt/preferences, apt-cache policy ${EDITOR} /etc/portage/package.keywords Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source.
Modify HoldPkg and/or IgnorePkg arrays Add a line with =category/package-version
/etc/apt/preferences ${EDITOR} /etc/portage/package.keywords Remove a previously set priority
remove offending line
apt-cache policy /etc/apt/preferences cat /etc/portage/package.keywords Show a list of set priorities.
Ignores problems that priorities may trigger.
Verification and repair Verification and repair
pacman -Qk[k] debsums equery check Verify single package
pacman -Qk[k] debsums equery check Verify all packages
pacman -S apt install –reinstall emerge -1O Reinstall given Package – Will reinstall the given package without dependency hassle.
pacman -Dk apt-get check emerge -uDN world Verify dependencies of the complete system. Used if installation process was forcefully killed.
pacman dep level – pacman -Dk, shared lib level – findbrokenpkgs or lddd apt-get –fix-broken revdep-rebuild Use some magic to fix broken dependencies in a system
aptitude install
Add a checkpoint to the package system for later rollback
N/A Remove a checkpoint from the system
N/A Provide a list of all system checkpoints
N/A Rolls entire packages back to a certain date or checkpoint.
N/A Undo a single specified transaction.
Using package files and building packages Using package files and building packages
pacman -Qp dpkg -I Query a package supplied on the command line rather than an entry in the package management database
pacman -Qpl dpkg -c List the contents of a package file
pacman -U apt install emerge Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies
pacman -U debi emerge Updates package(s) with local packages and uses the installation sources to resolve dependencies
cp $filename /var/cache/pacman/pkg/ apt-cache add cp $filename /usr/portage/distfiles Add a local package to the local package cache mostly for debugging purposes.
tar -Jxvf dpkg-deb -x tar -jxvf Extract a package
automatic apt-get build-dep emerge -o Install/Remove packages to satisfy build-dependencies. Uses information in the source package.
apt-cache showsrc Display the source package to the given package name(s)
Use ABS && makepkg -o apt-get source / debcheckout emerge –fetchonly Downloads the corresponding source package(s) to the given package name(s)
makepkg -s debuild ebuild; quickpkg Build a package
namcap lintian repoman Check for possible packaging issues
Arch Debian/Ubuntu Gentoo Action

And this we hope is all …. ooooffff!!

4 thoughts on “Cross reference table for package management (apt pacman emerge — debian arch gentoo)

  1. If you go through this list and find something you think it is not accurate please bring it up so we can correct it. Although the work done and published in the arch-wiki is great, we find ourselves some questionable discrepancies, such as pacman -U and apt install, we have allways used dpkg -i for installing local packages.

    Liked by 1 person

  2. A less insane package like apt and pacman
    I find it next to impossible to memorize emerge and layman terminology, but I am still fighting myself to “like” Gentoo 🙂 I am writing this from Gentoo, Clover to be more accurate. Lxterminal will not work, still, but terminator does.

    $ epkg –help
    Usage: epkg command [package(s)]

    epkg is a simple wrapper around portage, gentoolkit, and eix that provides an
    apt-get/yum-alike interface to these commands, to assist people transitioning from
    Debian/RedHat-based systems to Gentoo.

    Commands [equivalent Gentoo command]:
    install – Install new packages [emerge -av package(s)]
    remove – Remove packages safely [emerge –depclean -av packages(s)]
    update – Retrieve updated portage tree [eix-sync]
    upgrade – Update installed packages [emerge -NDuav –with-bdeps=y @system world]
    search – Search for packages [eix package]
    autoremove – Remove packages that are no longer needed [emerge –depclean -a]
    autoclean – Remove sources for packages no longer installed [eclean-dist -df]
    clean – Remove ALL package sources [rm -rf $DISTDIR/]
    forceremove – *Unsafely
    remove packages [emerge –unmerge -av package(s)]
    listfiles – List the files belonging to a package [equery files package]
    listinstalled – List installed packages [equery list ‘‘]
    provides – List the installed package(s) which own the indicated file [equery belongs file]
    verify – Verify a package’s installed files match the checksum and timestamp they had when first installed [equery check -o package]
    verifyall – Same as above, but against all installed packages [equery check -o ‘
    sysinfo – Display information about installed core packages and portage configuration [emerge –info]

    You can pass arbitrary parameters to us after the command you want, and we’ll
    forward them on to the underlying command.

    See epkg(1), emerge(1), equery(1), eix(1), and eclean(1) for more information.

    We immediately bought some hats so we’d blend in.


If your comment is considered off-topic a new topic will be created with your comment to continue a different discussion. This community is based on open and free communication, meaning we must all respect all in minimizing the exercise of freedom to disrupt such communication. Feel free to post what you think but keep in mind the subject matter discussed. It is just as easy to start a new topic as it is to dilute the content of an existing discussion.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.