0

Reason I'm asking: pycurl requires both libcurl-devel and openssl-devel. To install these, I have these two lines the my .bash_profile:

sudo yum install libcurl-devel
sudo yum install -y openssl-devel

Previously, I just ran those commands in the terminal while ssh'd into the EC2 instance.

However, it seems that at random times those lines are cleared from the .bashrc and .bashprofile, and the packages no longer exist in the instance. Why is this happening? Is the EC2 instance refreshing to a clean version at some point? If so, why? And how can I ensure those two packages are default installed on every instance?

When I eb deploy I still see the .bashrc and .bash_profile contain the yum install commands. The timing the files are refreshed seems random, and I can't figure out why.

Daniel Johnson
  • 193
  • 2
  • 14
  • You should not be installing software (which only needs to be done once) from `.bash_profile` (which gets sourced each time you login). `sudo yum install pycurl`, wherever you run that, should install both `pycurl` and all its dependencies. – chepner Mar 02 '23 at 20:23
  • @chepner the issue is that `libcurl-devel` and `openssl-devel` aren't python packages, so they aren't installed – Daniel Johnson Mar 03 '23 at 21:01
  • I'm assuming you are using `pip`, not `yum`, to install `pycurl`? This is one reason why it's still useful to use language-agnostic package managers. You can create an RPM for `pycurl` that does little more than run `pip install pycurl` and includes `libcurl-devel` and `openssl-devel` as dependencies. – chepner Mar 03 '23 at 21:09
  • @chepner yep, you're correct. Do you have any resources I could reference? That sounds to be exactly what I need. – Daniel Johnson Mar 03 '23 at 21:16

2 Answers2

1

You may consider adding the User Data script to your launch template.

Alex Chadyuk
  • 1,421
  • 2
  • 10
0

I solved this by adding a linix.config file within my /.ebextensions folder.

Contents of linix.config:

commands:
  libcurl-devel:
    command: sudo yum install -y libcurl-devel
    ignoreErrors: true
  openssl-devel:
    command: sudo yum install -y openssl-devel
    ignoreErrors: true
Daniel Johnson
  • 193
  • 2
  • 14