Home » Random Goodies » How to install EPEL, Remi, and RPM Fusion (one-liners)

How to install EPEL, Remi, and RPM Fusion (one-liners)

While there’s a few articles out there on this, personally I can’t stand the broken links to the release packages. As a SysAdmin, speed is critical. With speed being critical, and all of us having our trusty set of one-liners to shave time off repetitive tasks, I wanted to post an easy method of always grabbing the latest release packages and not having to worry about a new version coming out causing your one-liner to 404 while you’re busy dealing with other fires.

Long story short:

– EPEL for CentOS 5/6 32bit or 64bit:
[[ "$(grep ^'CentOS release 5\.' /etc/redhat-release)" ]] && c=5 || { [[ "$(grep ^'CentOS release 6\.' /etc/redhat-release)" ]] && c=6;};[[ "$c" ]] && rpm -Uhv `lynx --dump http://dl.fedoraproject.org/pub/epel/${c}/x86_64/|grep -oP 'http://.*epel-release.*.noarch.rpm$'`

– Remi:
[[ "$(grep ^'CentOS release 5\.' /etc/redhat-release)" ]] && c=5 || { [[ "$(grep ^'CentOS release 6\.' /etc/redhat-release)" ]] && c=6;};[[ "$c" ]] && rpm -Uhv http://rpms.famillecollet.com/enterprise/remi-release-${c}.rpm

– RPM Fusion (requires EPEL):
[[ "$(grep ^'CentOS release 5\.' /etc/redhat-release)" ]] && c=5 || { [[ "$(grep ^'CentOS release 6\.' /etc/redhat-release)" ]] && c=6;};[[ "$c" ]] && rpm -Uhv --replacepkgs http://download1.rpmfusion.org/free/el/updates/${c}/i386/rpmfusion-free-release-${c}-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/${c}/i386/rpmfusion-nonfree-release-${c}-1.noarch.rpm

All-in-One EPEL, Remi and RPM Fusion:

[[ "$(grep ^'CentOS release 5\.' /etc/redhat-release)" ]] && c=5 || { [[ "$(grep ^'CentOS release 6\.' /etc/redhat-release)" ]] && c=6;};[[ "$c" ]] && { rpm -Uhv `lynx --dump http://dl.fedoraproject.org/pub/epel/${c}/x86_64/|grep -oP 'http://.*epel-release.*.noarch.rpm$'`  http://rpms.famillecollet.com/enterprise/remi-release-${c}.rpm http://download1.rpmfusion.org/free/el/updates/${c}/i386/rpmfusion-free-release-${c}-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/${c}/i386/rpmfusion-nonfree-release-${c}-1.noarch.rpm; }

Comments & concerns welcome as always 🙂