首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未安装在ubuntu22.04上的AWS CodeDeploy代理

未安装在ubuntu22.04上的AWS CodeDeploy代理
EN

Stack Overflow用户
提问于 2022-08-10 06:52:43
回答 2查看 1.9K关注 0票数 5

我尝试在ubuntu 22.04上安装codedeploy,但没有工作。我已经通过rbenv安装了ruby 2.6.0

代码语言:javascript
复制
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.

我还尝试手动安装.deb文件,但没有工作。

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2022-08-16 17:07:48

按照顺序运行以下命令:

代码语言:javascript
复制
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
票数 20
EN

Stack Overflow用户

发布于 2022-09-08 18:28:59

如果您想安装CodeDeploy代理的最新版本,并且也可以安装JQ,可以使用以下脚本:

代码语言:javascript
复制
#!/bin/bash
# This installs the CodeDeploy agent and its prerequisites on Ubuntu 22.04.

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

SOURCE="https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/releases/"
DEBFILE=$(curl -s https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/LATEST_VERSION| jq .deb -r| sed -e 's|releases/||')
DEBNAME=$(echo $DEBFILE | sed -e 's|.deb||')

cd /tmp
wget $SOURCE$DEBFILE
mkdir $DEBNAME
dpkg-deb -R $DEBFILE $DEBNAME
sed 's/Depends:.*/Depends:ruby3.0/' -i ./$DEBNAME/DEBIAN/control
dpkg-deb -b $DEBNAME/
sudo dpkg -i $DEBFILE
systemctl list-units --type=service | grep codedeploy
sudo service codedeploy-agent status
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73301858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档