Searching Available Packages

On Debian/Ubuntu

apt-cache search $name

On CentOS/Fedora

apt-cache search $name

On Gentoo

emerge -s $name

Installing Packages

On Debian/Ubuntu

apt-get install $name

On Gentoo

emerge -av $name

Upgrading Packages / System

On Debian/Ubuntu

apt-get update
apt-get upgrade

On Gentoo

emerge --sync
emerge -avuDN @world

Searching Installed Packages

On Debian/Ubuntu

dpkg -l |grep $name

On Gentoo

equery l '*$name*'

Removing Packages

On Debian/Ubuntu

apt-get remove $name

On Gentoo

emerge -Cv $name

Purging Packages

On Debian/Ubuntu, and use the dpkg output to then dpkg --purge.

apt-get autoremove
dpkg -l | grep '^rc'
dpkg --purge $name

Re-Packaging

On Debian/Ubuntu.

apt-get install dpkg-repack
dpkg-repack $name