EC2 .bashrc and .bash_profile re-setting

281 Views Asked by At

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.

1

There are 1 best solutions below

0
Daniel Johnson On

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