Installing Firefox on Buiidkite

Is it just a matter of running the following commands?

sudo apt-get install firefox
sudo apt-get install firefox-geckodriver

Hey @ebanster good question :wave: although this can be a little tricky to answer since the agent doesn’t run on our infrastructure and can run on so many different operating systems.

If you are using our Elastic CI Stack, which is running on Amazon Linux which is a flavour of Fedora. So the package manager will be yum.
Although, the firefox docs don’t mention such an install method. You could try one of the methods listed here: Install Firefox on Linux | Firefox Help

Otherwise, could you provide some more info on how your buildkite-agent is running? And we can help you get firefox installed :+1:

Thanks for the quick response. Its running against Amazon Linux AMI 2 so I guess I could use yum.

1 Like

It seems I cant directly install it via yum so what I did per the Firefox doc link you provided is:

yum install flatpak
flatpak install flathub org.mozilla.firefox

I get this error though: You need to be root to perform this command.

Hmm you might need to run with sudo or something like that. Or perhaps another installation method would work better

I tried with sudo initially but understandably, it prompted asking for password:
[sudo] password for buildkite-agent:

Hmm I wasn’t aware it was set up with a sudo password. Are you using the Elastic Stack?

You could instead install firefox when the instance boots up, using a custom script with the BootstrapScriptUrl CloudFormation parameter. That way you don’t need to do it within your build steps and that should run with elevated privileges already.
Alternatively, you could create your own AMI based off our default that already has firefox installed so you don’t need to do it at boot each time