EC2 .bashrc and .bash_profile re-setting

2024/11/19 21:34:53

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.

Answer

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-develignoreErrors: trueopenssl-devel:command: sudo yum install -y openssl-develignoreErrors: true
https://en.xdnf.cn/q/118490.html

Related Q&A

How to load mutiple PPM files present in a folder as single Numpy ndarray?

The following Python code creates list of numpy array. I want to load by data sets as a numpy array that has dimension K x M x N x 3 , where K is the index of the image and M x N x 3 is the dimension …

Python: Understanding Threading Module

While learning Pythons threading module Ive run a simple test. Interesting that the threads are running sequentially and not parallel. Is it possible to modify this test code so a program executes the …

How the program has control with the break statement [closed]

Its difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying thi…

Python: how to plot data coming from different excel sheets in the same chart

I need to create an interactive chart on python taking data from different sheets of an Excel file. I tried to create a for loop to take data from all the sheets automatically, but I manage to graph on…

Dynamic html table with django [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 6…

Driving costs - functions in python- EOFerror in if __name__ == __main__:

I am stuck with this question: Write a function driving_cost() with input parameters miles_per_gallon, dollars_per_gallon, and miles_driven, that returns the dollar cost to drive those miles. All items…

Pandas loc dynamic conditional list

I have a Pandas DataFrame and I want to find all rows where the ith column values are 10 times greater than other columns. Here is an example of my DataFrame:For example, looking at column i=0, row B (…

no module named numpy python2.7

Im using python 2.7 on Linux CentOS 6.5. After successfully using yum to install numpy, I am unable to import the module.from numpy import *The above code produces the following error:no module named …

TypeError: list indices must be integers or slices, not tuple for list of tuples

I am getting "list indices must be integers or slices, not tuple" error while trying to generate list from list of tuples. list of tuples have the following structure:[(29208, 8, 8, 8), (2920…

Spark Unique pair in cartesian product

I have this:In [1]:a = sc.parallelize([a,b,c]) In [2]:a.cartesian(a).collect() Out[3]: [(a, a), (a, b), (a, c), (b, a), (c, a), (b, b), (b, c), (c, b), (c, c)]I want the following result:In [1]:a = sc.…