Intalling gdb and pstack on Amazon Linux AMI

0

I tried installing gdb and pstack on EC2 Instance with Amazon Linux AMI (it was not installed by default), and it's not working.

Tried:

[ec2-user@ip-172-21-ab-xyz ~]$ sudo yum install gdb
Loaded plugins: priorities, update-motd, upgrade-helper
No package gdb available.
Error: Nothing to do

[ec2-user@ip-172-21-ab-xyz ~]$ sudo yum install pstack
Loaded plugins: priorities, update-motd, upgrade-helper
No package pstack available.
Error: Nothing to do

Tried to manually put gdb tar on AMI and compile it, but it didn't work.
Not sure where to get RPMs for AMI. Where to download the packages from ?

Can anyone guide me on how to install GDB and pstack on AMI ?

K.K

Posted 2014-10-08T17:30:46.880

Reputation: 101

Answers

1

The gdb package is available from the Amazon Linux AMI repositories. The repositories should be configured by default. In your case I suspect that you instance cannot contact the repositories so it cannot download the package. To see what repositories you have enabled run:

sudo yum repolist

This should return something like:

Loaded plugins: priorities, update-motd, upgrade-helper
repo id                        repo name          status
amzn-main/latest               amzn-main-Base     5,017+2
amzn-updates/latest            amzn-updates-Base  111
repolist: 5,136

If you don't have these repos listed, then make sure you instance can get to the repository (usually allow access to the internet). Also, make sure you haven't made any changes to the files in the /etc/yum.repos.d/ directory.

The pstack command is included in the gdb package, so a seperate package for pstack is not needed.

-Heath

Heath

Posted 2014-10-08T17:30:46.880

Reputation: 11

I am not seeing these repositories listed, what should I do? What do you mean by allowing access to internet? The instance has access to internet (I am able to download other packages). – K.K – 2014-10-10T07:35:15.603

What repositories do you have listed? The repsositories are configured in the /etc/yum.repos.d directory. Make sure the amzn-main and amzn-updates repositories are enabled. – Heath – 2014-10-10T16:39:49.750