Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Essential installation script for Amazon Linux 2
#!/bin/bash
#############################################
# Initialization Script for Amazon Linux 2
#############################################
# Set up a clean UTF-8 environment
sudo bash -c 'echo "LANG=en_US.utf-8
LC_ALL=en_US.utf-8" > /etc/environment'
# Set the Timezone to KST
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# Yum update & Install essential packages
sudo yum update -y
sudo yum install htop gtk3 -y
# Docker
sudo amazon-linux-extras install docker -y
sudo service docker start
sudo usermod -a -G docker ec2-user
# docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Anaconda
# curl -O https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-aarch64.sh
curl -O https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
# bash Anaconda3-2022.05-Linux-aarch64.sh -b -p $HOME/anaconda3
bash Anaconda3-2022.05-Linux-x86_64.sh -b -p $HOME/anaconda3
# New environment with Python 3.9
source anaconda3/bin/activate
conda init bash
conda create -y -n hyperai python=3.9
bash -c 'echo "
source ~/anaconda3/bin/activate hyperai
" >> ~/.bash_profile'
########################
# Development Tools
########################
$ sudo yum groupinstall "Development Tools"
# for AWS Elastic Inference
$ source activate amazonei_tensorflow_p36
########################
# nodejs & gnomon
########################
$ sudo yum install -y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -
$ sudo yum install -y nodejs
$ sudo npm install -g gnomon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment