Currently AWS Codedeploy agent on Ubuntu 18.04 LTS does not install properly due to mismatch on ruby dependencies under 18.04 (installs 2.5, but codeploy only works with 2.3)

Run the following script as a workaround

# Ruby 2.5
sudo apt -y install ruby

# Ruby 2.3 (fake)
sudo apt -y install equivs
cd /tmp
equivs-control ruby2.3.control
perl -pi -e 's{^Package.*}{Package: ruby2.3}' ruby2.3.control
equivs-build ruby2.3.control
sudo dpkg -i ruby2.3_1.0_all.deb

# AWS CodeDeploy (us-east-1)
cd /tmp
wget https://aws-codedeploy-<aws_region>.s3.amazonaws.com/latest/install
perl -pi -e "s{\\['2.4', '2.3', '2.2', '2.1', '2.0'\\]}{['2.5', '2.4', '2.3', '2.2', '2.1', '2.0']}" install
chmod 755 install
sudo ./install auto