无法重新安装codedeploy-agent

时间:2016-05-13 14:29:15

标签: amazon-web-services amazon-ec2 aws-code-deploy

我已使用以下命令从区域:us-west-2中的某个ec2实例中删除了代码部署代理:

sudo dpkg -r codedeploy-agent

正如文档http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent.html#how-to-verify-agent-version-ubuntu

中所述

要重新安装,我在执行

时从s3存储桶中复制了安装
sudo ./install auto 

我收到此消息:

I, [2016-05-13T14:20:03.902026 #5227]  INFO -- : Starting Ruby version check.
I, [2016-05-13T14:20:03.902274 #5227]  INFO -- : The current Ruby version is not 2.0.x! Restarting the installer with /usr/bin/ruby2.0
I, [2016-05-13T14:20:04.043343 #5227]  INFO -- : Starting Ruby version check.
I, [2016-05-13T14:20:04.043548 #5227]  INFO -- : Starting update check.
I, [2016-05-13T14:20:04.043649 #5227]  INFO -- : Attempting to automatically detect supported package manager type for system...
I, [2016-05-13T14:20:04.048600 #5227]  INFO -- : Checking AWS_REGION environment variable for region information...
I, [2016-05-13T14:20:04.048712 #5227]  INFO -- : Checking EC2 metadata service for region information...
I, [2016-05-13T14:20:04.103736 #5227]  INFO -- : Running version 1.0-1.950
I, [2016-05-13T14:20:04.103871 #5227]  INFO -- : Downloading version file from bucket aws-codedeploy-us-west-2 and key latest/VERSION...
I, [2016-05-13T14:20:04.169833 #5227]  INFO -- : Running version matches target version, skipping install
I, [2016-05-13T14:20:04.170000 #5227]  INFO -- : Update check complete.
I, [2016-05-13T14:20:04.170094 #5227]  INFO -- : Stopping updater.

2 个答案:

答案 0 :(得分:0)

$host1 = "<HostIP>"
Connect-VIServer -Server $host1 -User user -Password pass
$vmname = Get-VM
$n = $vm = 0
$datastore = Get-Datastore DS*     
for($i = 0; $i -le $num_disks; $i++) {
        $size = $datastore[$i].CapacityGB - 1     #Deducting 1GB from each Datastore. Full sized DS as a VM fails as it need some space to write VM data
        $vmnamenew = $vmname[$i]
        write-host "Size of VMDK to be added : ", $size
        write-host "VMname will be           : ", $vmnamenew
        write-host "Datastore used is        : ", $datastore[$n]
        New-HardDisk -vm $vmnamenew -CapacityGB ($size) -Datastore $datastore[$n] -StorageFormat $format    #Mounting the Datastore to VMs.
        Start-Sleep -s 20

这不会完全删除codedeploy-agent

我跑了

sudo dpkg -r codedeploy-agent

然后

sudo apt-get purge codedeploy-agent

它对我有用

答案 1 :(得分:0)

sudo dpkg --purge可以胜任。