Skip to content

Instantly share code, notes, and snippets.

@marttosc
Last active February 14, 2024 10:32
Show Gist options
  • Save marttosc/e9eb99992ecfce871522c6efd53bec73 to your computer and use it in GitHub Desktop.
Save marttosc/e9eb99992ecfce871522c6efd53bec73 to your computer and use it in GitHub Desktop.
HowTo: Install developer softwares in Elementary OS
#!/bin/bash
# Author: Gustavo Marttos <marttosc@gmail.com>
#
# Run this scrupt with sudo, e.g.: sudo ./install_elemos.sh
COLOR_DEFAULT='\033[0;0;39m'
COLOR_WHITE='\033[1;37m'
COLOR_BLACK='\033[0;30m'
COLOR_BLUE='\033[0;34m'
COLOR_LIGHT_BLUE='\033[1;34m'
COLOR_GREEN='\033[0;32m'
COLOR_LIGHT_GREEN='\033[1;32m'
COLOR_CYAN='\033[0;36m'
COLOR_LIGHT_CYAN='\033[1;36m'
COLOR_RED='\033[0;31m'
COLOR_LIGHT_RED='\033[1;31m'
COLOR_PURPLE='\033[0;35m'
COLOR_LIGHT_PURPLE='\033[1;35m'
COLOR_BROWN='\033[0;33m'
COLOR_YELLOW='\033[1;33m'
COLOR_GRAY='\033[0;30m'
COLOR_LIGHT_GRAY='\033[0;37m'
if [ "$(id -u)" != "0" ]; then
echo -e "${COLOR_RED}This script must be run as root!${COLOR_DEFAULT}" 1>&2
exit 1
fi
cd /tmp
# Verify if package exists
package_exists() {
if [ ! -z "$1" ]; then
type "$1" &> /dev/null
else
return 0
fi
}
# Pause terminal
pause() {
if [ -z "$1" ]; then
read -p " Press [Enter] to continue..."
else
read -p "$*"
fi
}
# Clean-up system
cleanup_system() {
apt-get autoremove -y
apt-get autoclean -y
}
# Update your system
update_system() {
apt-get update
}
# Upgrade your system
upgrade_system() {
apt-get upgrade -y
}
# Update and upgrade your system
update_upgrade_system() {
update_system
upgrade_system
}
# Install Ubuntu Restricted Extras
install_ubuntu_restricted_extras() {
apt-get install ubuntu-restricted-extras -y
}
# Tweak your Elementary
install_tweak_elementary() {
apt-add-repository ppa:mpstark/elementary-tweaks-daily -y
update_system
apt-get install elementary-tweaks -y
}
# Install Google Chrome
install_google_chrome() {
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
update_system
apt-get install google-chrome-stable -y
}
# Install VLC
install_vlc() {
apt-get install vlc -y
}
# Install Git
install_git() {
apt-add-repository ppa:git-core/ppa -y
update_system
apt-get dist-upgrade
apt-get install git -y
}
# Install Dropbox
install_dropbox() {
if ! package_exists 'git'; then
install_git
fi
git clone https://github.com/zant95/elementary-dropbox elementary-dropbox
bash elementary-dropbox/install.sh -y
rm -rf elementary-dropbox
}
# Install Sublime Text 3 build 3114
install_sublime_text() {
wget -q -O sublime-text.deb https://download.sublimetext.com/sublime-text_build-3114_amd64.deb
dpkg -i sublime-text.deb
}
# Install File Compression Libs
install_file_compression_libs() {
apt-get install unace unrar zip unzip xz-utils p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract -y
}
# Install Java 8
install_java() {
apt-get install python-software-properties -y
apt-add-repository ppa:webupd8team/java -y
update_system
apt-get install oracle-java8-installer oracle-java8-set-default -y
}
# Install TLP
install_tlp() {
apt-add-repository ppa:linrunner/tlp -y
update_system
apt-get install tlp tlp-rdw -y
tlp start
}
# Install FileZilla
install_filezilla() {
apt-get install filezilla -y
}
# Install Eclipse
install_eclipse() {
wget -q -O eclipse-jee-mars.tar.gz http://eclipse.c3sl.ufpr.br/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-linux-gtk-x86_64.tar.gz
tar -zxvf eclipse-jee-mars.tar.gz
cd eclipse-jee-mars
mv eclipse /opt
chmod 755 -R /opt/eclipse
chmod +x /opt/eclipse/eclipse
eclipse_file="/usr/share/applications/eclipse.desktop"
if [ ! -f "$eclipse_file" ]; then
touch $eclipse_file
cat > $eclipse_file <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=/opt/eclipse/eclipse
Icon=eclipse
Categories=Application;Development;Java;IDE
Type=Application
Terminal=0
EOF
fi
}
# Install Synaptic
install_synaptic() {
apt-get install synaptic -y
}
# Install Bleachbit
install_bleachbit() {
wget -q -O bleachbit.deb https://download.bleachbit.org/bleachbit_1.10_all_ubuntu1404.deb
dpkg -i bleachbit.deb
}
# Install DConf Tools
install_dconf_tools() {
apt-get install dconf-tools -y
}
# Install Gparted
install_gparted() {
apt-get install gparted -y
}
# Install Deluge
install_deluge() {
apt-add-repository ppa:deluge-team/ppa -y
update_system
apt-get install deluge -y
}
# Install Teamviewer
install_teamviewer() {
ARCH=$(uname -m)
if [ "x86_64" == "$ARCH" ]; then
wget -q -O teamviewer11.deb http://downloadus2.teamviewer.com/download/version_11x/teamviewer_11.0.57095_amd64.deb
else
wget -q -O teamviewer11.deb http://downloadus2.teamviewer.com/download/version_11x/teamviewer_11.0.57095_i386.deb
fi
dpkg -i teamviewer11.deb
}
# Install Tor Browser Bundle
install_tor_browser_bundle() {
apt-add-repository ppa:webupd8team/tor-browser
update_system
apt-get install tor-browser -y
}
# Install Tor
install_tor() {
list="/etc/apt/sources.list.d/tor.list"
if [ ! -f "$list"]; then
touch $list
cat > $list <<EOF
deb http://deb.torproject.org/torproject.org trusty main
deb-src http://deb.torproject.org/torproject.org trusty main
EOF
fi
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
update_system
apt-get install tor deb.torproject.org-keyring -y
}
# Install Remmina
install_remmina() {
apt-add-repository ppa:remmina-ppa-team/remmina-next -y
update_system
apt-get install remmina remmina-plugin-rdp libfreerdp-plugins-standard -y
}
# Install Thunderbird
install_thunderbird() {
add-apt-repository ppa:ubuntu-mozilla-security/ppa -y
update_system
apt-get install thunderbird -y
}
# Install GitEye
install_giteye() {
ARCH=$(uname -m)
if [ "x86_64" == "$ARCH" ]; then
wget -q -O giteye.zip https://downloads-guests.open.collab.net/files/documents/61/12536/GitEye-1.12.0-linux.x86_64.zip
else
wget -q -O giteye.zip https://downloads-guests.open.collab.net/files/documents/61/12535/GitEye-1.12.0-linux.x86.zip
fi
# Continue here...
}
# Uninstall Midori
uninstall_midori() {
apt-get purge midori-granite -y
cleanup_system
}
# Uninstall Geary
uninstall_geary() {
apt-get purge geary -y
cleanup_system
}
FIRST_EXECUTE=1
# Show info
show_info() {
clear
echo " #################################"
echo -e " ${COLOR_CYAN}Elementary - Install Helper${COLOR_DEFAULT} "
echo " #################################"
echo -e "\n This script was created to be used on Elementary OS,\n but you can use it in Ubuntu too (however some programs will not work,\n like Elementary Tweak)."
echo -e "\n Your \$HOME is: ${COLOR_PURPLE}${HOME}${COLOR_DEFAULT}"
echo
if [ "/root" == "$HOME" ]; then
read -p " Your \$HOME is \"/root\", that's correct? [y/N] " is_root
case $is_root in
[Yy])
;;
* )
exit
;;
esac
fi
}
# Show menu
show_menu() {
echo -e "\n ${COLOR_RED}ALERT: if you already chose the fourth option, you \n should take care to install some softwares!${COLOR_DEFAULT}"
echo -e "\n Enter an option: "
echo -e " 1. Update your system"
echo -e " 2. Upgrade your system"
echo -e " 3. Update an upgrade your system"
echo -e " 4. ${COLOR_RED}Install all the packages below${COLOR_DEFAULT}"
echo -e " 5. Ubuntu Restricted Extras"
echo -e " 6. Elementary Tweak"
echo -e " 7. Google Chrome"
echo -e " 8. VLC"
echo -e " 9. Git"
echo -e " 10. Dropbox for Elementary ${COLOR_PURPLE}(requires Git [9])${COLOR_DEFAULT}"
echo -e " 11. Sublime Text 3 Build 3114"
echo -e " 12. File Compression Libs"
echo -e " 13. Java 8"
echo -e " 14. TLP - Reduce overheating and improve battery life"
echo -e " 15. FileZilla"
echo -e " 16. Eclipse Mars"
echo -e " 17. Synaptic"
echo -e " 18. Bleachbit"
echo -e " 19. DConf Tools"
echo -e " 20. Gparted"
echo -e " 21. Deluge"
echo -e " 22. Teamviewer"
echo -e " 23. Tor Browser"
echo -e " 24. Tor"
echo -e " 25. Remmina"
echo -e " 26. Thunderbird"
echo
echo -e " 27. ${COLOR_RED}Uninstall${COLOR_DEFAULT} Midori"
echo -e " 28. ${COLOR_RED}Uninstall${COLOR_DEFAULT} Geary"
echo
echo -e " 29. ${COLOR_CYAN}Quit${COLOR_DEFAULT}"
echo
}
# Read options
read_options() {
local choice
read -p " Enter choice [1 - 29] " choice
case $choice in
1)
update_system
pause
;;
2)
upgrade_system
pause
;;
3)
update_upgrade_system
pause
;;
4)
install_ubuntu_restricted_extras
install_tweak_elementary
install_google_chrome
install_vlc
install_git
install_dropbox
install_sublime_text
install_file_compression_libs
install_java
install_tlp
install_filezilla
install_eclipse
install_synaptic
install_bleachbit
install_dconf_tools
install_gparted
install_deluge
install_teamviewer
install_tor_browser_bundle
install_tor
install_remmina
install_thunderbird
pause
;;
5)
install_ubuntu_restricted_extras
pause
;;
6)
install_tweak_elementary
pause
;;
7)
install_google_chrome
pause
;;
8)
install_vlc
pause
;;
9)
install_git
pause
;;
10)
install_dropbox
pause
;;
11)
install_sublime_text
pause
;;
12)
install_file_compression_libs
pause
;;
13)
install_java
pause
;;
14)
install_tlp
pause
;;
15)
install_filezilla
pause
;;
16)
install_eclipse
pause
;;
17)
install_synaptic
pause
;;
18)
install_bleachbit
pause
;;
19)
install_dconf_tools
pause
;;
20)
install_gparted
pause
;;
21)
install_deluge
pause
;;
22)
install_teamviewer
pause
;;
23)
install_tor_browser_bundle
pause
;;
24)
install_tor
pause
;;
25)
install_remmina
pause
;;
26)
install_thunderbird
pause
;;
27)
uninstall_midori
pause
;;
28)
uninstall_geary
pause
;;
29|quit|exit|[Qq]) exit 0 ;;
*) echo -e "${COLOR_RED}Invalid option '${choice}'!${COLOR_DEFAULT}" && sleep 2
esac
}
while true
do
show_info
# User can read the informations before showing the menu.
if [ 1 == $FIRST_EXECUTE ]; then
FIRST_EXECUTE=0
pause
fi
show_menu
read_options
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment