1

I'm trying to get bash 4.2 (or a more recent version) on Amazon Linux in ec2. The default repository only has Bash 4.1. I'm looking for a yum repository with a recent version.

$ sudo yum install bash
...
Package bash-4.1.2-15.23.amzn1.x86_64 already installed and latest version

This question has now been cross posted to serverfault where they have an amazon-linux tag. Probably should have posted there first.

Travis Well
  • 183
  • 1
  • 2
  • 8

1 Answers1

1

I don't know of any repositories that will provide you with BASH 4.3 for Amazon Linux.

If you have a specific requirement for this version of BASH then you're probably going to have to compile it from source, if you've no experience in doing that then this could be quite technical, there are some instructions on this over at the BASH FAQ; ftp://ftp.cwru.edu/pub/bash/FAQ.

Is there a specific reason that you need BASH 4.3? I'd be interested to hear it if so.

UPDATE: I've just spun up an Amazon EC2 instance running the latest version of Amazon Linux and upgraded bash by compiling from source. There was no dependency issues and everything worked as expected for me.

Download the latest package from http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz and follow the install instructions from http://www.linuxfromscratch.org/lfs/view/development/chapter06/bash.html. Once done I rebooted the system and it booted fine using the new version of bash. I tried running a couple of scripts I had laying around which worked with older versions of BASH and they appear fine.

Obviously if this is a production system please test on a dev/staging/test environment first!

Chris Davidson
  • 1,427
  • 1
  • 9
  • 10
  • 1
    I don't necessarily need 4.3 actually, but I do need 4.2 to support scripts that use `[[ -v VARIABLE ]]`. I will edit the question to specify that. – Travis Well Dec 09 '14 at 19:22
  • @TravisWellman I've just updated my answer, I tested compiling from source and all appeared to work quite well. – Chris Davidson Dec 09 '14 at 20:13
  • Thank you for the detailed answer. It isn't really the answer I need, so I can't really accept it. I would upvote your answer for being useful, but I don't have 15 rep yet. – Travis Well Dec 09 '14 at 20:17
  • No problem, sorry I couldn't be of more help :) – Chris Davidson Dec 09 '14 at 20:23