-
Notifications
You must be signed in to change notification settings - Fork 0
/
softwareInstall_metagen_ubuntu2v.sh
executable file
·94 lines (70 loc) · 4.38 KB
/
softwareInstall_metagen_ubuntu2v.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
# system-wide configuration and upgrade needed for csuser to install metagenomics software.
# must be run prior to creating the metagenomicsxs AWS AMI
source ~/bin/colour_utils_functions.sh # to add colour to some messages and more
#------------ script START
cd
if [ ! -d logs ]; then
message "Creating directory logs"
mkdir logs
fi
logfile=logs/metagenomics_sftwre_install_ubuntuuser.sh`date '+%Y%m%d.%H%M%S'`.txt
message "System is about to be upgraded and configured for csuser to install metagenomics software."
message "This script and the software install by csuser is prior to creating the metagenomics AMI."
message "`colour red "*** NB"`: the `colour lb aws` cli must have been configured already - cancel installation if not."
message "`colour red "*** NB"`: you must have increased the size of storage with `colour brown aws_storageEBS_increase.sh`."
read -n 1 -p "Do you want to continue (y/n)?: " option
if [ "$option" != "n" -a "$option" != "N" -a "$option" != "y" -a "$option" != "Y" ]; then
message "\nWrong option $option. Script cancelled." $logfile
exit 1;
elif [ "$option" == "n" -o "$option" == "N" ]; then
message "\nScript cancelled ($option)." $logfile
exit 1;
fi
message "\n($option): Configuring and upgrading system. Please wait:" $logfile
sudo apt-get update | tee -a $logfile
message "`colour lg "sudo apt-get upgrade"`" $logfile
sudo apt-get upgrade -y | tee -a $logfile
message "`colour lg "sudo apt-get install libssl-dev"`" $logfile
sudo apt-get install -y libssl-dev | tee -a $logfile
message "`colour lg "sudo apt-get install libncurses5-dev"`" $logfile
sudo apt-get install -y libncurses5-dev | tee -a $logfile
message "`colour lg "sudo apt-get install libgsl0-dev"`" $logfile
sudo apt-get install -y libgsl0-dev | tee -a $logfile
message "`colour lg "sudo apt-get install python3-pip"`" $logfile
sudo apt install -y python3-pip | tee -a $logfile
message "`colour lg "sudo apt-get install porechop"`" $logfile
sudo apt-get install -y porechop | tee -a $logfile
message "`colour lg "sudo apt update -qq"`" $logfile
sudo apt update -qq | tee -a $logfile
message "`colour lg "sudo apt install --no-install-recommends software-properties-common dirmngr"`" $logfile
sudo apt install -y --no-install-recommends software-properties-common dirmngr # to update software manager
message "`colour lg "wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc"`" $logfile
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
message "`colour lg "sudo add-apt-repository \"deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/\""`" $logfile
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" | tee -a $logfile
message "`colour lg "sudo apt install --no-install-recommends r-base"`" $logfile
sudo apt install -y --no-install-recommends r-base | tee -a $logfile
message "`colour lg "sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+"`" $logfile
sudo add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+ # REGISTERING REPO
message "`colour lg "sudo apt-get install docker.io"`" $logfile
sudo apt install -y docker.io | tee -a $logfile
message "`colour lg "sudo groupadd docker"`" $logfile
sudo groupadd docker | tee -a $logfile # docker group existed already
message "`colour lg "sudo usermod -aG docker csuser"`" $logfile
sudo usermod -aG docker csuser | tee -a $logfile
message "`colour lg "sudo apt-get install hmmer"`" $logfile
sudo apt install hmmer | tee -a $logfile
message "`colour lg "sudo apt install prokka"`" $logfile
sudo apt install prokka | tee -a $logfile
message "`colour lg "sudo apt-get update"`" $logfile
sudo apt-get update -y | tee -a $logfile
message "`colour lg "sudo apt-get upgrade"`" $logfile
sudo apt-get upgrade -y | tee -a $logfile
###
message "`colour lg "----------------------"`." $logfile
message "`colour lb "DONE system-wide setting and upgrade"` for csuser to install metagenomics software." $logfile
message "CHECK the log file $logfile." $logfile
message "You may `colour red "need to reboot"` (sudo shutdown --reboot now) the system more than once" $logfile
message "and run the next command (CHECK login message for updates):" $logfile
message "`colour lightbrown "sudo apt-get --with-new-pkgs upgrade --yes"`" $logfile