Monthly Archives: September 2015

Yum makes it easy

Often when I’m trying to figure out how to do something in Centos I’ll do the same thing as millions of other programmers and just Google the answer. But for some reason Centos top-hit results seems to have very convoluted answers for things that have much, much easier answers.

Note that I’m currently working with Centos 6.6/6.7. YMMV for other versions.

As a minor example: when you’re new to centos and want to find out how to install the epel repo you end up with guides having you wget or curl an rpm and then using rpm to install it. This top result from Google is one example of this: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/

It’s not really that hard to do … and it certainly works …but there’s a way to do it in yum with the install you already have. You could just issue a

sudo yum install epel-release

It’s much the same for trying to figure out how to get a more recent release of python installed on the system. Centos comes with Python 2.6 and sometimes being able to use Python 2.7 or 3.3 would make life so much better. Here’s the top StackOverflow result for this topic: http://stackoverflow.com/questions/10624511/upgrade-python-without-breaking-yum

Those methods certainly work … but what if there was an easier way with just a yum command or two?  Indeed, newer packages are just a yum command away:

yum install centos-release-SCL

Additional information here: https://wiki.centos.org/AdditionalResources/Repositories/SCL
and here: https://www.softwarecollections.org/en/

And Python 2.7.8 – https://www.softwarecollections.org/en/scls/rhscl/python27/

Hope this helps save others some time