首页 > 解决方案 > 无法在 centos 7 上删除 CodeDeploy 代理

问题描述

我使用命令:

sudo yum erase codedeploy-agent 

卸载 codedeploy-agent。但无法卸载并记录错误如下:

Stop codedeploy-agent in preun hook if this is an erase.
Stopping codedeploy-agent:Unable to stop the running codedeploy-agent
Canceling uninstall of the agent..
error: %preun(codedeploy-agent-1.2.1-1868.noarch) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package codedeploy-agent-1.2.1-1868.noarch
  Verifying  : codedeploy-agent-1.2.1-1868.noarch                                                                                                                                                                                     
1/1

Failed:
  codedeploy-agent.noarch 0:1.2.1-1868

Complete!

当我更改用户配置文件以运行 codedeploy-agent 但我设置了错误的用户名时,因此生成了错误。 https://aws.amazon.com/premiumsupport/knowledge-center/codedeploy-agent-non-root-profile/

编码部署代理的状态

sudo service codedeploy-agent status
sudo: unknown user: ec2-user
sudo: unable to initialize policy plugin

标签: amazon-web-servicesaws-code-deploy

解决方案


请在移动“/etc/codedeploy-agent/conf”下的现有配置文件后重试

例如: mv /etc/codedeploy-agent/conf/codedeployagent.yml /etc/codedeploy-agent/conf/codedeployagent.yml_safe


推荐阅读