我错误地删除了代码部署代理文件夹,现在我无法运行安装或代码部署擦除,
Stop codedeploy-agent in preun hook if this is an erase.
Stopping codedeploy-agent:/etc/init.d/codedeploy-agent: line 45: cd: /opt/codedeploy-agent/: No such file or directory
Unable to stop the running codedeploy-agent
Canceling uninstall of the agent..
error: %preun(codedeploy-agent-1.3.2-1902.noarch) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package codedeploy-agent-1.3.2-1902.noarch
Verifying : codedeploy-agent-1.3.2-1902.noarch 1/1
Failed:
codedeploy-agent.noarch 0:1.3.2-1902我如何重新安装代码部署代理或删除它现在?我试过sudo ./install auto
I, [2022-08-19T16:28:49.233152 #3540] INFO -- : Starting Ruby version check.
I, [2022-08-19T16:28:49.233406 #3540] INFO -- : Starting update check.
I, [2022-08-19T16:28:49.233511 #3540] INFO -- : Attempting to automatically detect supported package manager type for system...
I, [2022-08-19T16:28:49.241988 #3540] INFO -- : Checking AWS_REGION environment variable for region information...
I, [2022-08-19T16:28:49.242075 #3540] INFO -- : Checking EC2 metadata service for region information...
I, [2022-08-19T16:28:49.266428 #3540] INFO -- : Checking AWS_DOMAIN environment variable for domain information...
I, [2022-08-19T16:28:49.266506 #3540] INFO -- : Checking EC2 metadata service for domain information...
I, [2022-08-19T16:28:49.273211 #3540] INFO -- : Downloading version file from bucket aws-codedeploy-us-east-1 and key latest/LATEST_VERSION...
I, [2022-08-19T16:28:49.273619 #3540] INFO -- : Endpoint: https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/LATEST_VERSION
I, [2022-08-19T16:28:49.351061 #3540] INFO -- : Running version matches target version, skipping install
I, [2022-08-19T16:28:49.351223 #3540] INFO -- : Update check complete.
I, [2022-08-19T16:28:49.351255 #3540] INFO -- : Stopping updater.它不安装
发布于 2022-08-26 04:09:47
我已经修复了错误,因为我删除了/opt中的codedeploy文件夹,安装和擦除命令返回了错误,因为/etc/init.d在试图安装或擦除文件时引用了这些文件。因此,我删除了/etc/init.d中的码部署代理文件夹,方法是运行
"cd /etc/init.d sudo rm代码部署-代理“
然后"cd“返回到启动目录,然后运行
sudo yum擦除代码部署-代理sudo ./安装自动
请注意,在运行sudo之前。/安装自动,您必须已运行
sudo -y更新sudo yum -y安装ruby sudo yum -y install cd /home/ec2-用户wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install sudo chmod +x ./ install
发布于 2022-08-19 19:09:24
如果您使用的是Ubuntu,请检查正在运行的版本:
lsb_release -a如果您的Ubuntu服务器版本是>= 16.04,只需输入以下命令:
sudo apt update
sudo apt install ruby-full
sudo apt install wget然后
cd /home/ubuntu
wget https://bucket-name.s3.region-identifier.amazonaws.com/latest/install
sudo ./install auto现在检查服务是否正在运行:
sudo service codedeploy-agent status如果您没有使用Ubuntu,或者您的版本低于我提到的版本,请查看点击这里提供的AWS官方教程。
如果您删除该文件夹是因为复制了Codedeploy,则生成每个可以使您的磁盘空间耗尽的部署过程,下次,只需删除部署根中的文件夹并设置CodeDeployofmax_revision即可。查看更多信息。
https://stackoverflow.com/questions/73418863
复制相似问题