How to install software on Red Hat?

For Red Hat Enterprise Linux and derivatives:

$ yum install foo

For Fedora:

$ dnf install foo

For Debian and derivatives such as Ubuntu (run this as root) :

# apt-get install foo

For Debian/Ubuntu

aptitude install firefox

For Fedora i think it is

yum install firefox

[note] Run these as root.


If you are using Red Hat Enterprise Linux, it happens that the package you are looking for is in EPEL, so you can install that:

sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

and then you can yum install ncdu.

If you are using ancient Red Hat Linux, the answer is for the love of all that is holy, time to upgrade to Fedora.