Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeDeploy agent not installing on ubuntu 22.04

I tried installing codedeploy agent on ubuntu 22.04 but not working. I have installed ruby 2.6.0 via rbenv.

ubuntu@ip-172-31-37-7:~$ sudo ./install --sanity-check  deb
I, [2022-08-10T06:26:28.905059 #47961]  INFO -- : Starting Ruby version check.
I, [2022-08-10T06:26:28.905394 #47961]  INFO -- : Starting update check.
I, [2022-08-10T06:26:28.905593 #47961]  INFO -- : Checking AWS_REGION environment variable for region information...
I, [2022-08-10T06:26:28.905770 #47961]  INFO -- : Checking EC2 metadata service for region information...
I, [2022-08-10T06:26:28.921018 #47961]  INFO -- : Checking AWS_DOMAIN environment variable for domain information...
I, [2022-08-10T06:26:28.921228 #47961]  INFO -- : Checking EC2 metadata service for domain information...
I, [2022-08-10T06:26:28.926802 #47961]  INFO -- : Downloading version file from bucket aws-codedeploy-ap-south-1 and key latest/LATEST_VERSION...
I, [2022-08-10T06:26:28.927009 #47961]  INFO -- : Endpoint: https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/LATEST_VERSION
I, [2022-08-10T06:26:28.966467 #47961]  INFO -- : Running version 1.3.2-1902
I, [2022-08-10T06:26:28.966733 #47961]  INFO -- : Running version matches target version, skipping install
I, [2022-08-10T06:26:28.966856 #47961]  INFO -- : Update check complete.
I, [2022-08-10T06:26:28.966972 #47961]  INFO -- : Stopping updater.

I have also tried to install the .deb file manually but not working

ubuntu@ip-172-31-37-7:~$ sudo dpkg -i codedeploy-agent_1.3.2-1902_all.deb 
(Reading database ... 75862 files and directories currently installed.)
Preparing to unpack codedeploy-agent_1.3.2-1902_all.deb ...
Failed to stop codedeploy-agent.service: Unit codedeploy-agent.service not loaded.
Unable to stop the running codedeploy-agent
Canceling upgrade.
dpkg: error processing archive codedeploy-agent_1.3.2-1902_all.deb (--install):
 new codedeploy-agent package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 codedeploy-agent_1.3.2-1902_all.deb
like image 709
Mahim Safa Avatar asked Jul 08 '26 20:07

Mahim Safa


1 Answers

Run the following commands in order:


sudo apt-get install ruby-full ruby-webrick wget -y

cd /tmp

wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/releases/codedeploy-agent_1.3.2-1902_all.deb

mkdir codedeploy-agent_1.3.2-1902_ubuntu22

dpkg-deb -R codedeploy-agent_1.3.2-1902_all.deb codedeploy-agent_1.3.2-1902_ubuntu22

sed 's/Depends:.*/Depends:ruby3.0/' -i ./codedeploy-agent_1.3.2-1902_ubuntu22/DEBIAN/control

dpkg-deb -b codedeploy-agent_1.3.2-1902_ubuntu22/

sudo dpkg -i codedeploy-agent_1.3.2-1902_ubuntu22.deb

sudo systemctl list-units --type=service | grep codedeploy

sudo service codedeploy-agent status
like image 145
David K Avatar answered Jul 11 '26 15:07

David K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!