Red Hat



Find a package

apt-cache search <term>
aptitude search <term>

yum search <term>

emerge --search <term>

pacman -Ss <term>
or for local search
pacman -Qs <term>

Automatically install a package

aptitude install <package>

yum install <package>

emerge <package>

pacman -S <package>

Install a local package

dpkg -i <packagename>

rpm -i <package>
yum localinstall <package.rpm>

ebuild <file> merge (?)

pacman -U <packagename>

Remove a local package

dpkg -r <packagename>

rpm -e <packagename>

pacman -Rs <packagename>

List all packages already installed

dpkg -l | grep ^ii

List specific packages already installed matching

dpkg -l <packagename> | grep ^ii

List contents of an already installed package

dpkg -L <packagename>

rpm -ql <packagename>

equery files <package> [2]

pacman -Ql <packagename>

Remove a package

aptitude remove <packagename>

yum remove <packagename>

emerge --unmerge <package>

pacman -R <packagename>

Remove a package (and its dependants)

apt-get autoremove <packagename>

yum remove <packagename>

pacman -Rs <packagename>

Re-install a package

aptitude reinstall <packagename>

yum reinstall <packagename>

emerge <package>

pacman -S <packagename>

Identify what package

dpkg -S file

rpm -qf </path/to/file>
yum whatprovides </path/to/file>

emerge belongs </path/to/file>

pacman -Qo </path/to/file>

Find meta-information about package

dpkg -s <packagename>
aptitude show <packagename>

rpm -qi <package>

emerge --search <package>
genlop -i <package>

pacman -Qi <packagename>
or for packages not installed
pacman -Si <packagename>

Show (un)installation scriptlets

rpm -qp --scripts <package>

Show package files marked as config files

rpm -qc <package>

equery files --filter=conf <package>

Find out what needs this package

apt-cache rdepends package

rpm -q --whatrequires <packagename>

equery depends <package>

pacman -Qi <packagename>
or for packages not installed
pacman -Si <packagename>

Find out what this package needs

apt-cache show package

rpm -q --requires <packagename>

equery depgraph <package>

pacman -Qi <packagename>
or for packages not installed
pacman -Si <packagename>

Find out what this package provides

apt-cache show package

rpm -q --provides <packagename>
yum provides <package>

pacman -Qi <packagename>
or for packages not installed
pacman -Si <packagename>

Find out what has changed in this package since installation

aptitude changelog <packagname>
That shows you the changelog, not what has been changed since installation!

rpm -V <packagename>

Find what package contains <file>

apt-file search <file>

yum search file
rpm -qf </path/to/file>

pkgfile <file>

Clean our local package cache

aptitude clean

yum clean <whatever>[3]

pacman -Sc

Download and unpack source

apt-get source <package>

yumdownloader --source <package>
Doesn't "unpack" anything - but that's not required for rpmbuild

emerge -f <package>
(only downloads)

pacman -Sw <package> (download only)
abs <package> (sync PKGFILE in ABS [4])
makepkg --nobuild (download and extract source for PKGFILE)

Download, unpack and build

apt-get source --compile <package>


Install build requirements

apt-get build-dep <package>

yum-builddep <package>

makepkg -s (also downloads source and builds)

Display a list of package groups available

yum grouplist <optional filter text, e.g. yum grouplist dev*>

Install a group of package

N/A -- c.f. meta-packages.

yum groupinstall <groupname>

pacman -S <groupname>

Upgrade existing packages

aptitude safe-upgrade

emerge --noreplace world

pacman -Su (normally pacman -Syu)

Upgrade existing packages and pull in new dependents

aptitude full-upgrade

yum upgrade

emerge --noreplace world

pacman -Su (normally pacman -Syu)

List security issues

yum list-security

glsa-check -l affected [2]

Update list of packages

aptitude update

-- not required --

emerge --sync

pacman -Sy

List packages with updates

yum list updates

emerge -p --noreplace world

pacman -Qu

[1] While apt-get is commonly used on debians, it is officially deprecated and aptitude should be used instead. In most cases an apt-get command can be directly replaced with an aptitude command and vice-a-versa.

[2] One of the tools available in the gentoolkit package

[3] yum has quite a bit of granularity in what can be cleaned out

[4] See http://wiki.archlinux.org/index.php/Arch_Build_System

See Also http://www.slideshare.net/macoafi/sysadmins-rosetta-stone

CommandLineEquivalents (last edited 2010-10-22 16:00:31 by popey)