How to install software on Red Hat?

What’s the simplest way to download/install software on Red Hat Linux (from bash command line)?

Asked By: ripper234


For Debian/Ubuntu

aptitude install firefox

For Fedora i think it is

yum install firefox

[note] Run these as root.

Answered By: Johan

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
Answered By: sudobash

In debian based system you can use
sudo apt-get install foo
to download you can use wget

Answered By: Keshan

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

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.

Answered By: mattdm

For RHEL distrib for remote installation and repositories installation to yum OK, Here we have some additional details :

RHEL2, RHEL3 and RHEL4 :

    up2date -i pkg-name


    yum install pkg-name

Note RHEL8 can also :
dnf install pkg-name

think about module appstream for apps in RHEL8 :
for instance : mariadb

      #use the default module version
      yum module install mariadb 
      #select module version
      yum module install mariadb:10.5

      #select the profile
      yum module install mariadb:10.5/Client

yum group install group-pkg-name


    yum groupinstall group-pkg-name 

up2date "@group-pkg-name"

If you have to install any rpm package local, avoid to use :

    rpm -ivh http://... 

and prefer use :

    OBSOLETE : yum localinstall http://... 
    now : yum install http://mywebiste/mypackage.rpm


Legacy distribution RHEL2, RHEL3, RHEL4 :

    up2date -k pkg-name 

Note : maybe http://… if not wget -0 http://… after up2date -k pkg-name

All of this to keep your metainformation yum (or up2date) ok and sync with rpm.

Answered By: GnuTux95