# install build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
# yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27
sudo sed -i s/python/python2.6/g /usr/bin/yum
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum
# should display now 2.7.5 or later:
python -V
# now install pip for 2.7
sudo curl -o /tmp/ez_setup.py
https://sources.rhodecode.com/setuptools/raw/bootstrap/ez_setup.py
sudo /usr/bin/python27 /tmp/ez_setup.py
sudo /usr/bin/easy_install-2.7 pip
sudo pip install virtualenv
# should display current versions:
pip -V && virtualenv --version
Install/Update to Python 2.7 on CentOS 6.5:
$ python --version
Python 2.6.6
$
$ sudo yum groupinstall "Development tools"
$ sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
$ cd /opt
$ sudo wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
$ sudo tar xf Python-2.7.6.tar.xz
$ cd Python-2.7.6
$ sudo ./configure --prefix=/usr/local
$ sudo make && sudo make altinstall
NOTE: It is important to use ‘altinstall’ otherwise you will end up with two different versions of Python on your filesystem, both named ‘python’.
You can verify the install like so
$ ls -la /usr/local/bin/python2.7*
-rwxr-xr-x 1 root root 6214493 Apr 30 15:14 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 1674 Apr 30 15:14 /usr/local/bin/python2.7-config
$ /usr/local/bin/python2.7 --version
Python 2.7.6
$
# change default python symlink
$ sudo rm /usr/bin/python
$ sudo ln -s /usr/local/bin/python2.7 /usr/bin/python
$
$ python --version
Python 2.7.6
$
Install psycopg2 on AWS EC2 Linux:
sudo yum install gcc python-setuptools python-devel postgresql-devel sudo pip install psycopg2
Install AWS CLI on new AWS EC2 Linux:
<Ref: http://aws.amazon.com/cli/>
Requires Python 2.6.5 or higher.
# run following commands on command prompt under home directory
pip install awscli
aws configure
-----
AWS Access Key ID [None]: <enter your access key>
AWS Secret Access Key [None]:<enter your secret key>
Default region name [None]: <optional default AWS region>
Default output format [None]: <optional output format, if you don't know just hit "enter/return">
-----
Above steps would create .aws hidden folder under home directory.
You can change keys anytime via either of following:
- run aws configure command again under home directly
- editing .aws/config file. You con maintain multiple profile with different keys as well
Check your AWS CLI are woking by issue following command under your home directory:
aws s3 ls
Above command should list all the S3 buckets of your AWS account.
Install Git on new AWS EC2 Linux:
sudo yum install git
Install tmux on new AWS EC2 Linux:
sudo yum install libevent-devel
method1:
sudo yum install tmux
method2:
wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz
tar zxf tmux-1.8.tar.gz
cd tmux-1.8
sudo make clean
sudo ./configure
sudo make
sudo ./tmux -V
sudo make install
Comments
Post a Comment