How to install collectd in AWS EC2 in one step with no failed commands

2

1

I want to install collectd in AWS EC2. Im running as root:

yum install collectd -y

Output:

# yum install collectd -y
Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package collectd.x86_64 0:5.8.0-2.19.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
=========================================================================================================================
Package                   Arch                    Version                              Repository                  Size
=========================================================================================================================
Installing:
collectd                  x86_64                  5.8.0-2.19.amzn1                     amzn-main                  702 k

Transaction Summary
=========================================================================================================================
Install  1 Package

Total download size: 702 k
Installed size: 1.6 M
Downloading packages:
collectd-5.8.0-2.19.amzn1.x86_64.rpm                                                              | 702 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : collectd-5.8.0-2.19.amzn1.x86_64                                                                      1/1 
Error unpacking rpm package collectd-5.8.0-2.19.amzn1.x86_64
error: unpacking of archive failed on file /usr/sbin/collectdmon;5d71797f: cpio: open
  Verifying  : collectd-5.8.0-2.19.amzn1.x86_64                                                                      1/1 

Failed:
  collectd.x86_64 0:5.8.0-2.19.amzn1                                                                                     

Complete!

After trying a bunch of stuff, I got to the conclusion that running the command 6 times in a row would succeed installing it:

Output:

# yum install collectd -y
Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package collectd.x86_64 0:5.8.0-2.19.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================
 Package                   Arch                    Version                              Repository                  Size
=========================================================================================================================
Installing:
 collectd                  x86_64                  5.8.0-2.19.amzn1                     amzn-main                  702 k

Transaction Summary
=========================================================================================================================
Install  1 Package

Total download size: 702 k
Installed size: 1.6 M
Downloading packages:
collectd-5.8.0-2.19.amzn1.x86_64.rpm                                                              | 702 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : collectd-5.8.0-2.19.amzn1.x86_64                                                                      1/1 
  Verifying  : collectd-5.8.0-2.19.amzn1.x86_64                                                                      1/1 

Installed:
  collectd.x86_64 0:5.8.0-2.19.amzn1                                                                                     

Complete!

I ran in 3 different EC2 in a row and I don't run anything else apart from 6 consecutive times the same command so it seems its deterministic. I would like to know if there is something am missing or if there is a correct way to properly install collectd running the command once.

EC2 details:

NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"

I would appreciate any insight or guidance, Thanks!

9uzman7

Posted 2019-09-05T22:04:01.653

Reputation: 121

Answers

0

The problem was with yum repolist being outdated (yum repolist). Running yum update following with yum install collectd -y installed collectd successfully running the command once.

9uzman7

Posted 2019-09-05T22:04:01.653

Reputation: 121