Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeDeploy-Agenten on Ubuntu 20.0LTS, Ruby errors

I've got some errors, while trying to install the AWS code-deploy agent via :

wget https://bucket-name.s3.region-identifier.amazonaws.com/latest/install

./install auto

I know the AWS documentation said 16.04 or 18.04. But wondering if I am the first who tried it.

Traceback (most recent call last):
    8: from ./install:33:in `<main>'
    7: from ./install:33:in `new'
    6: from /usr/lib/ruby/2.7.0/logger.rb:389:in `initialize'
    5: from /usr/lib/ruby/2.7.0/logger.rb:389:in `new'
    4: from /usr/lib/ruby/2.7.0/logger/log_device.rb:18:in `initialize'
    3: from /usr/lib/ruby/2.7.0/logger/log_device.rb:83:in `set_dev'
    2: from ./install:21:in `method_missing'
    1: from ./install:21:in `map'
./install:22:in `block in method_missing': undefined method `path' for #<IO:<STDOUT>> (NoMethodError)

Would be nice if some one have a tip.

best and thx

like image 254
mickmack Avatar asked Jun 09 '20 16:06

mickmack


2 Answers

Apparently CodeDeploy is not yet compatible with Ubuntu 20.04 since the latter comes with ruby 2.7 while CodeDeploy supports max 2.5. There is a solution here which repacks the deb package to force the check to pass:

sudo su
apt-get update
apt-get install -y ruby
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/releases/codedeploy-agent_1.0-1.1597_all.deb
mkdir codedeploy-agent_1.0-1.1597_ubuntu20
dpkg-deb -R codedeploy-agent_1.0-1.1597_all.deb codedeploy-agent_1.0-1.1597_ubuntu20
sed 's/2.0/2.7/' -i ./codedeploy-agent_1.0-1.1597_ubuntu20/DEBIAN/control
dpkg-deb -b codedeploy-agent_1.0-1.1597_ubuntu20
dpkg -i codedeploy-agent_1.0-1.1597_ubuntu20.deb
systemctl start codedeploy-agent
systemctl enable codedeploy-agent
like image 170
Khalid Hazam Avatar answered Sep 28 '22 00:09

Khalid Hazam


To install the latest version of the CodeDeploy agent on Ubuntu 20.04:

sudo ./install auto > /tmp/logfile

Note: Writing the output to a temporary log file is a workaround that should be used while AWS address a known bug with the install script on Ubuntu 20.04.

Source: https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html

like image 24
Muhammad Abu ul Fazal Avatar answered Sep 28 '22 01:09

Muhammad Abu ul Fazal