Issue in the installation of the AWS CodeDeploy Agent in EC2 instance with AMI - Ubuntu Server 22.04 LTS

0

have created an Amazon EC2 instance with AMI - Ubuntu Server 22.04 LTS (Free Tier) and try to install AWS CodeDeploy Agent into it.

I am following the official documentation from Amazon to install CodeDeploy agent into the Ubuntu server. [https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html](AWS Documentation Link)

I have connected the EC2 instance with SSH Keypairs and run the following commands:

sudo apt update

sudo apt install ruby-full

sudo apt install wget

wget https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/install

chmod +x ./install

sudo ./install auto

In the last command, I got the following error message:

I, [2022-11-25T20:22:45.262298 #4303] INFO -- : Starting Ruby version check.

E, [2022-11-25T20:22:45.262740 #4303] ERROR -- :Current running Ruby version for root is 3.0.2, but Ruby version 2.x needs to be installed.

E, [2022-11-25T20:22:45.262959 #4303] ERROR -- : If you already have the proper Ruby version installed, please either create a symlink to /usr/bin/ruby2.x,

E, [2022-11-25T20:22:45.263173 #4303] ERROR -- : or run this install script with right interpreter. Otherwise please install Ruby 2.x for root user.

E, [2022-11-25T20:22:45.263378 #4303] ERROR -- : You can get more information by running the script with --help option.

Please let me know if there is any other hacks, I should employ to install AWS CodeDeploy agent in the EC2 instance with with AMI - Ubuntu Server 22.04 LTS (Free Tier).

Thanks in advance!!

asked a year ago1557 views
1 Answer
1

Hello,

Ubuntu 22.04 is currently not officially supported for the CodeDeployAgent, see: https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent.html

Supported Amazon EC2 AMI operating system:
The CodeDeploy agent has been tested on the following Amazon EC2 AMI operating systems:
   - Amazon Linux 2018.03.x
   - Amazon Linux 2 (ARM, x86)
   - Ubuntu Server 20.04 LTS, 18.04 LTS, 16.04 LTS, and 14.04 LTS
   - Microsoft Windows Server 2019, 2016, 2012 R2, and 2008 R2
   - Red Hat Enterprise Linux (RHEL) 8.x, 7.x

So I would suggest you switch to another operating system like Ubuntu Server 20.04 LTS.

But you can still try to install an older rubyversion and test if it works. Check out this blog for installing an older rubyversion on ubuntu-22-04: https://blog.francium.tech/setting-up-ruby-2-7-6-on-ubuntu-22-04-fdb9560715f7

Basically what he does are three commands:

sudo apt install gnupg2
rvm pkg install openssl
rvm install 2.7.6 --with-openssl-dir=$HOME/.rvm/usr

Other way: https://stackoverflow.com/questions/72162001/aws-code-deploy-agent-needs-ruby-2-x-to-run-and-you-cant-install-older-version-o

You could also open an github-issue to ask for 22.04-support: https://github.com/aws/aws-codedeploy-agent

profile picture
HeikoMR
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions