Skip to content

Instantly share code, notes, and snippets.

@rahulsprajapati
Created September 22, 2016 05:37
Show Gist options
  • Save rahulsprajapati/28819bcc63094abc87d4e6cc4d5ecd76 to your computer and use it in GitHub Desktop.
Save rahulsprajapati/28819bcc63094abc87d4e6cc4d5ecd76 to your computer and use it in GitHub Desktop.
Install all necessary packages on fresh ubuntu machine.
#!/bin/bash
# Error handling
function error()
{
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)"
exit $2
}
# Unhide Startup
sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop
# Execute: apt-get update
apt-get update \
|| error "Unable to execute apt-get update command, exit status = " $?
# Google Repository
echo "Adding google-chrome repository, please wait..."
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - \
&& sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|| ee_lib_error "Unable to add google-chrome repository, exit status = " $?
# Shutter Repository
echo "Adding shutter repository, please wait..."
sudo add-apt-repository -y ppa:shutter/ppa \
|| ee_lib_error "Unable to add shutter repository, exit status = " $?
# Skype Repository
echo "Adding skype repository, please wait..."
sudo sh -c 'echo "deb http://archive.canonical.com/ubuntu/ $(lsb_release -sc) partner" >> /etc/apt/sources.list.d/canonical_partner.list' || ee_lib_error "Unable to add skype repository, exit status = " $?
#NodeJs Repository
clear
echo "Install Repository For NodeJs..."
#sudo add-apt-repository -y ppa:chris-lea/node.js || ee_lib_error "Unable to add NodeJS repository, exit status = " $?
apt-get -y install nodejs npm
# Execute: apt-get update
apt-get update \
|| error "Unable to execute apt-get update command, exit status = " $?
# Update System
apt-get -y upgrade
# Install required packages
echo "Installing necessary packages, please wait..."
#apt-get -y install curl wget git openssh-server shutter google-chrome-stable vlc skype diodon nautilus-open-terminal ruby2.0 ruby2.0-dev ruby2.0-doc nodejs || error "Unable to install required packages, exit status = " $?
apt-get -y install curl wget git openssh-server shutter google-chrome-stable vlc skype diodon vim filezilla || error "Unable to install required packages, exit status = " $?
# Install ruby with rvm
clear
echo "Installing ruby-fill package, please wait..."
sudo apt-get install ruby-full
# Execute: apt-get update
apt-get update \
|| error "Unable to execute apt-get update command, exit status = " $?
# Add gpg key for ruby
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# Install rvm with root user, so other user can also use it
echo "Installing rvm stable package, please wait..."
\curl -sSL https://get.rvm.io | sudo bash -s stable
# Add current user to the rvm group so user can access rvm installed packages without sudo
sudo usermod -a -G rvm $USER
#Install SASS
clear
echo "Install SASS"
sudo gem install sass || ee_lib_error "Unable to add SASS, exit status = " $?
#Install Compass
clear
echo "Install Compass"
sudo gem install compass || ee_lib_error "Unable to add Compass, exit status = " $?
#Install Foundation
clear
echo "Install Foundation"
sudo gem install foundation || ee_lib_error "Unable to add Foundation, exit status = " $?
#Install Grunt CLI
clear
echo "Install Grunt"
sudo npm install -g grunt-cli || ee_lib_error "Unable to add Grunt, exit status = " $?
#Install Bower
clear
echo "Install Bower"
sudo npm install -g bower || ee_lib_error "Unable to add Bower, exit status = " $?
#Install Web Server
wget -qO ee rt.cx/ee && sudo bash ee || ee_lib_error "Unable to install ee, exit status = " $?
source /etc/bash_completion.d/ee || ee_lib_error "Unable to source ee autocompletion, exit status = " $?
echo
echo "All Task Susscessfully Finished........"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment