August 17, 2018 admin

Making sure you install the correct version with yum

This has happened to me more than once so I thought I’d jot it down. Many times when you read tutorials on how to install different software packages on Linux you will simply see

sudo yum install package_name

However this may not install the version of the software you actually intended.

For example, say you want to install Apache httpd server.

A tutorial will say

sudo yum install httpd

Apache at the time of this writing is Apache 2.4 and running the above common on my Amazon instance would actually install Apache 2.1.

So here are some steps to walk through to make sure you install what you think you are installing when using a package manager.

1) See if the software package is installed and if it is the version you intend to install.

you list all installed software packages with

yum list intalled

but why not narrow it down if you know the package name. Use wildcard for good measure in case there are multiple version out there.

yum list httpd*

2) If it is not listed, then you need to install it but check to see what version would be installed.

For example,

sudo yum install httpd will install Apache HTTP Server 2.2

yum info httpd
Loaded plugins: priorities, update-motd, upgrade-helper
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.2.34
Release     : 1.16.amzn1
Size        : 1.2 M
Repo        : amzn-main/latest
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

3) Install the version you want

First we need to see what versions are available in our repositories.

[ec2-user@ip-172-30-1-156 ~]$ yum list all httpd*
Loaded plugins: priorities, update-motd, upgrade-helper
Available Packages
httpd.x86_64                                                                         2.2.34-1.16.amzn1                                                                 amzn-main   
httpd-devel.x86_64                                                                   2.2.34-1.16.amzn1                                                                 amzn-main   
httpd-manual.noarch                                                                  2.2.34-1.16.amzn1                                                                 amzn-main   
httpd-tools.x86_64                                                                   2.2.34-1.16.amzn1                                                                 amzn-main   
httpd24.x86_64                                                                       2.4.33-2.80.amzn1                                                                 amzn-updates
httpd24-devel.x86_64                                                                 2.4.33-2.80.amzn1                                                                 amzn-updates
httpd24-manual.noarch                                                                2.4.33-2.80.amzn1                                                                 amzn-updates
httpd24-tools.x86_64                                                                 2.4.33-2.80.amzn1                                                                 amzn-updates

There we are the Apache HTTP version we want, 2.4.

sudo yum install httpd24

Leave a Reply

Your email address will not be published. Required fields are marked *