Ubuntu 18.04环境下CodeDeploy Agent卸载后重装失败求助
AWS EC2 Ubuntu服务器CodeDeploy Agent重装修复步骤
1. 清理损坏依赖与残留文件
先修复apt依赖缓存问题,同时彻底清除CodeDeploy Agent的残留文件:
- 修复apt依赖链:
sudo apt-get update --fix-missing sudo apt-get install -f sudo dpkg --configure -a - 删除所有CodeDeploy相关残留目录与配置:
sudo rm -rf /opt/codedeploy-agent/ sudo rm -rf /etc/systemd/system/codedeploy-agent.service* sudo rm -rf /var/log/aws/codedeploy-agent/ sudo systemctl daemon-reload
2. 重新安装CodeDeploy Agent
按照Ubuntu环境标准流程执行安装:
- 安装基础依赖包:
sudo apt-get install ruby-full wget -y - 下载对应区域的CodeDeploy安装脚本(替换
us-east-1为你的EC2实例所在区域):wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install - 赋予脚本执行权限并自动安装:
chmod +x ./install sudo ./install auto
3. 验证安装与运行状态
- 检查服务当前状态:
sudo systemctl status codedeploy-agent - 若服务未启动,手动启动并设置开机自启:
sudo systemctl start codedeploy-agent sudo systemctl enable codedeploy-agent - 查看运行日志确认代理正常工作:
tail -f /var/log/aws/codedeploy-agent/codedeploy-agent.log
内容的提问来源于stack exchange,提问作者kavindu
相关产品推荐
相关产品推荐

