Instantly share code, notes, and snippets.

@scottsweb /setup-linux.sh Secret
Last active Apr 4, 2017

Embed
What would you like to do?
setup Ubuntu with all the trimmings
#!/bin/bash
# Settings
USER=scott
echo "Linux Setup Script"
read -p "Press any key to continue... " -n1 -s
echo -e "\n\n"
if (( $EUID != 0 )); then
echo "Please run as root"
exit
fi
# Common tools
# Allows add-apt-repository (elementary only)
# apt-get install software-properies-common
# Show fancy progress bars with apt
echo 'Dpkg::Progress-Fancy "1";' > /etc/apt/apt.conf.d/99progressbar
# Make sure we have curl
apt-get install -y -qq curl
# Add third party repos
echo Add Third Party Repos
echo -e "------------------------------\n"
add-apt-repository -y ppa:nilarimogard/webupd8 > /dev/null 2>&1 # Albert / Gloobus
add-apt-repository -y ppa:webupd8team/atom > /dev/null 2>&1 # Atom
add-apt-repository -y ppa:embrosyn/cinnamon > /dev/null 2>&1 # Cinnamon
# apt-add-repository -y ppa:hsoft/ppa > /dev/null 2>&1 # dupeGuru
# add-apt-repository -y ppa:alexlarsson/flatpak > /dev/null 2>&1 # Flatpak
# add-apt-repository -y ppa:moka/daily > /dev/null 2>&1 # Moka Icon Theme - issue with this repo
add-apt-repository ppa:peek-developers/stable > /dev/null 2>&1 # Peek
add-apt-repository -y ppa:ricotz/docky > /dev/null 2>&1 # Plank
add-apt-repository -y ppa:nathan-renniewaldock/flux > /dev/null 2>&1 # F.lux
# add-apt-repository -y ppa:rolfbensch/sane-git > /dev/null 2>&1 # Sane / xsane for Scanner
# add-apt-repository -y ppa:libretro/stable > /dev/null 2>&1 # RetroArch
# Heroku
curl -L -sS https://cli-assets.heroku.com/apt/release.key | apt-key add -
echo "deb https://cli-assets.heroku.com/branches/stable/apt ./" | tee /etc/apt/sources.list.d/heroku.list
# Neofetch
curl -L -sS "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" -o Release-neofetch.key && sudo apt-key add Release-neofetch.key && rm Release-neofetch.key
echo "deb http://dl.bintray.com/dawidd6/neofetch jessie main" | tee /etc/apt/sources.list.d/neofetch.list
# Syncthing
# curl -L -sS https://syncthing.net/release-key.txt | apt-key add -
# echo "deb https://apt.syncthing.net/ syncthing release" | tee /etc/apt/sources.list.d/syncthing.list
# Resilio Sync
curl -L -sS https://linux-packages.resilio.com/resilio-sync/key.asc | apt-key add -
echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" | tee /etc/apt/sources.list.d/resilio-sync.list
# Update all the things
echo -e "\n"
echo "Update & Upgrade"
echo -e "------------------------------\n"
apt-get update
apt-get upgrade -y -qq
# Install Icons & Themes
echo -e "\n"
echo Install Icons & Themes
echo -e "------------------------------\n"
# echo Arc Theme
# apt-get install -y -qq arc-theme - needs to be installed from source to work with cinnamon
# echo Moka Icon Theme
# apt-get install moka-icon-theme
# Install Apps
echo -e "\n"
echo Install Apps
echo -e "------------------------------\n"
#echo Albert
#apt-get install -y -qq albert # Albert
echo Arduino
apt-get install -y -qq arduino # Arduino
echo Atom
apt-get install -y -qq atom # Atom
echo Blueberry
apt-get install -y -qq blueberry # Blueberry (bluetooth for ciannmon)
echo Caffeine
apt-get install -y -qq caffeine # Caffeine
echo Cinnamon
apt-get install -y -qq cinnamon # Cinnamon desktop
echo Conky
apt-get install -y -qq conky # Conky
echo Corebird
apt-get install -y -qq corebird # Corebird
echo Dconf
apt install -y -qq dconf-editor # Dconf editor (edit settings)
# echo Docker
# apt-get install -y -qq docker.io # Docker - need to be installed manually for latest version and tools
# echo Docker Compose
# apt-get install -y -qq docker-compose # Docker Compose
echo Dropbox
apt-get install -y -qq dropbox # Dropbox
# echo dupeGuru
# apt-get install -y -qq dupeguru-se # dupeGuru
echo Firefox
apt-get install -y -qq firefox # Firefox
echo F.lux
apt-get install -y -qq fluxgui # F.lux
# echo Flatpak
# apt-get install -y -qq flatpak # Flatpak
# echo Gnome Sushi
# sudo apt-get install gnome-sushi # Gnome Sushi (quick look)
echo Gitg
apt-get install -y -qq gitg # Gitg
echo Gloobus
apt-get install -y -qq gloobus-preview gloobus-sushi unoconv gnumeric # Gloobus (quick look)
# echo Gnome Boxes
# apt-get install -y -qq gnome-boxes # Gnome Boxes
# echo Gnome MPV
# apt-get install -y -qq gnome-mpv
echo Handbrake
apt-get install -y -qq handbrake # Handbrake
echo Project Hamster
apt-get install -y -qq hamster-applet hamster-indicator # Project Hamster
echo Hedgewars
apt-get install -y -qq hedgewars # Hedgewars
echo LibreOffice
apt-get install -y -qq libreoffice # LibreOffice
echo Neofetch
apt-get install -y -qq neofetch # Neofetch
# echo MusicBrainz Picard
# apt-get install -y -qq picard # MusicBrainz Picard
echo Poedit
apt-get install -y -qq poedit # Poedit
echo Plank
apt-get install -y -qq plank # Plank
echo OpenVPN Manager
apt-get install -y -qq network-manager-openvpn-gnome # OpenVPN tools
echo Smuxi
apt-get install -y -qq smuxi # Smuxi
echo PlayOnLinux / Wine
# Related links
# https://appdb.winehq.org/objectManager.php?bShowAll=true&bIsQueue=false&bIsRejected=false&sClass=version&sTitle=&sReturnTo=&iId=34741
# https://helpx.adobe.com/creative-cloud/kb/creative-cloud-apps-download.html#
# apt-get install -y -qq wine-stable # Wine
# apt-get install -y -qq playonlinux # Play On Linux (Wine UI)
# apt-get install -y -qq libp11-kit-gnome-keyring:i386 # Required for Photoshop
echo Resilio Sync
apt-get install -y -qq resilio-sync # Resilio Sync
echo Rhythmbox
apt-get install -y -qq rhythmbox # Rhythmbox
# echo RetroArch
# apt-get install retroarch retroarch-* libretro-* # RetroArch
echo Screenfetch
apt-get install -y -qq screenfetch # Screenfetch
# echo Speedcrunch
# apt-get install -y -qq speedcrunch # Speedcrunch
# echo Syncthing
# apt-get install -y -qq syncthing # Syncthing
echo Steam
apt-get install -y -qq steam # Steam
echo Transmission
apt-get install -y -qq transmission # Transmission
apt-get install -y -qq virtualbox # VirtualBox
# apt-get install -y -qq virt-manager
# echo VLC
# apt-get install -y -qq vlc # VLC
# echo Zeal
# apt-get install -y -qq zeal # Zeal
# adbLink (broken)
# echo -e "\n"
# echo adbLink is about to be downloaded and installed to your home directory
# curl -O -J -L --progress-bar https://nl1.androidfilehost.com/dl/RE0j75L2UhK0cvnjozG6cg/1483109294/745425885120692373/adbll207.zip && unzip adbll207.zip && rm adbll207.zip
# Cerebro https://cerebroapp.com/
echo -e "\n"
echo Installing Cerebro (testing)
echo -e "------------------------------\n"
curl -O --progress-bar https://github.com/KELiON/cerebro/releases/download/0.2.6/cerebro-0.2.6-x86_64.AppImage && chmod +x cerebro-0.2.6-x86_64.AppImage
mkdir /opt/cerebro/ && mv cerebro-0.2.6-x86_64.AppImage /opt/cerebro/
# Color Oracle
# echo -e "\n"
# echo Color Oracle is about to be downloaded. Install ColorOracleJar.zip manually.
# curl -O --progress-bar http://colororacle.org/ColorOracleJar.zip && unzip ColorOracleJar.zip && rm ColorOracleJar.zip
# Chrome
echo -e "\n"
echo Installing Chrome Beta
echo -e "------------------------------\n"
curl -O --progress-bar https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb && apt install ./google-chrome-beta_current_amd64.deb -y -qq && rm google-chrome-beta_current_amd64.deb
# DBeaver
# echo -e "\n"
# echo Installing DBeaver (not required)
# echo -e "------------------------------\n"
# curl -o --progress-bar dbeaver.deb http://dbeaver.jkiss.org/files/3.8.2/dbeaver-ce_3.8.2_amd64.deb && apt install ./dbeaver.deb -y && rm dbeaver.deb
# Etcher / USB Image formatter (built in on Mint)
echo -e "\n"
echo Installing Etcher
echo -e "------------------------------\n"
curl -O --progress-bar https://resin-production-downloads.s3.amazonaws.com/etcher/1.0.0-beta.18/Etcher-1.0.0-beta.18-linux-x64.zip && unzip Etcher-1.0.0-beta.18-linux-x64.zip && rm Etcher-1.0.0-beta.18-linux-x64.zip && chmod +x Etcher-1.0.0-beta.18-linux-x64.AppImage
mkdir /opt/etcher/ && mv Etcher-1.0.0-beta.18-linux-x64.AppImage /opt/etcher/
# Fritzing
# echo -e "\n"
# echo Installing Fritzing
# echo -e "------------------------------\n"
# curl -O -J -L --progress-bar http://fritzing.org/download/0.9.3b/linux-64bit/fritzing-0.9.3b.linux.AMD64.tar.bz2 && tar -xjf fritzing-0.9.3b.linux.AMD64.tar.bz2 && rm fritzing-0.9.3b.linux.AMD64.tar.bz2
# Google Music Manager
echo -e "\n"
echo Instaling Google Music Manager
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://dl.google.com/linux/direct/google-musicmanager-beta_current_amd64.deb && apt install ./google-musicmanager-beta_current_amd64.deb -y -qq && rm google-musicmanager-beta_current_amd64.deb
# Google Web Designer
echo -e "\n"
echo Instaling Google Web Designer
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://dl.google.com/linux/direct/google-webdesigner_current_amd64.deb && apt install ./google-webdesigner_current_amd64.deb -y -qq && rm google-webdesigner_current_amd64.deb
# Gnome Games
# flatpak remote-add --from gnome-nightly https://sdk.gnome.org/gnome-nightly.flatpakrepo
# flatpak install gnome-games-nightly.flatpakref
# Harmony
echo -e "\n"
echo Installing Harmony
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://github.com/vincelwt/harmony/releases/download/v0.4.4/harmony-0.4.4-amd64.deb && apt install ./harmony-0.4.4-amd64.deb -y -qq && rm harmony-0.4.4-amd64.deb
# HyperTerm
# echo -e "\n"
# echo Installing HyperTerm
# echo -e "------------------------------\n"
# curl -O -J -L --progress-bar https://hyper-updates.now.sh/download/linux_deb && apt install ./hyper-1.0.1.deb -y -qq && rm hyper-1.0.1.deb
# Peek
echo -e "\n"
echo Intalling Peek
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://github.com/phw/peek/releases/download/v0.8.0/peek-0.8.0-Linux.deb && apt install ./peek-0.8.0-Linux.deb -y -qq && rm peek-0.8.0-Linux.deb
# Processing
# echo -e "\n"
# echo Intalling Processing
# echo -e "------------------------------\n"
# curl -O -J -L --progress-bar http://download.processing.org/processing-3.2.3-linux64.tgz && tar -zxf processing-3.2.3-linux64.tgz && rm processing-3.2.3-linux64.tgz
# Scanner
# apt-get install sane sane-utils libsane-extras
# Simplenote
echo -e "\n"
echo Installing Simplenote
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://github.com/Automattic/simplenote-electron/releases/download/v1.0.7/simplenote-1.0.7.deb && apt install ./simplenote-1.0.7.deb -y -qq && rm simplenote-1.0.7.deb
# Slack
echo -e "\n"
echo Installing Slack
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://downloads.slack-edge.com/linux_releases/slack-desktop-2.3.4-amd64.deb && apt install ./slack-desktop-2.3.4-amd64.deb -y -qq && rm slack-desktop-2.3.4-amd64.deb
# Stacer
echo -e "\n"
echo Installing Stacer
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://github.com/oguzhaninan/Stacer/releases/download/v1.0.3/Stacer_1.0.3_amd64.deb && apt install ./Stacer_1.0.3_amd64.deb -y -qq && rm Stacer_1.0.3_amd64.deb
# Temps (testing)
# echo -e "\n"
# echo Installing Temps
# echo -e "------------------------------\n"
# curl -O -J -L --progress-bar https://github.com/jackd248/temps/releases/download/v0.7.0/Temps-linux-x64.zip && unzip Temps-linux-x64.zip && rm Temps-linux-x64.zip
# WordPress
echo -e "\n"
echo Installing WordPress
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://public-api.wordpress.com/rest/v1.1/desktop/linux/download?type=deb && apt install ./wordpress-com-2-1-0.deb -y -qq && rm wordpress-com-2-1-0.deb
# Zazu
echo -e "\n"
echo Installing Zazu
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://github.com/tinytacoteam/zazu/releases/download/v0.4.0/zazu_0.4.0_amd64.deb && apt install ./zazu_0.4.0_amd64.deb -y -qq && rm zazu_0.4.0_amd64.deb
# Zoom
echo -e "\n"
echo Installing Zoom
echo -e "------------------------------\n"
curl -O -J -L --progress-bar https://zoom.us/client/latest/zoom_amd64.deb && apt install ./zoom_amd64.deb -y -qq && rm zoom_amd64.deb
echo -e "\n"
echo Remove Apps
echo -e "------------------------------\n"
echo Geary
apt-get remove -y -qq geary # Geary
echo Hexchat
apt-get remove -y -qq hexchat # Hexchat
echo Pidgin
apt-get remove -y -qq pidgin # Pidgin
# Development
echo -e "\n"
echo Installing Tools
echo -e "------------------------------\n"
apt-get install -y -qq autossh
apt-get install -y -qq build-essential
apt-get install -y -qq composer
apt-get install -y -qq exfat-fuse exfat-utils
apt-get install -y -qq git
apt-get install -y -qq httpie
apt-get install -y -qq jq
apt-get install -y -qq libvirt-clients
apt-get install -y -qq mysql-client
apt-get install -y -qq nano
apt-get install -y -qq python-pip
apt-get install -y -qq php7.0-cli
apt-get install -y -qq php7.0-curl
apt-get install -y -qq php7.0-fpm
apt-get install -y -qq php7.0-mbstring
apt-get install -y -qq php7.0-mcrypt
apt-get install -y -qq php7.0-mysql
apt-get install -y -qq php7.0-sqlite3
apt-get install -y -qq php7.0-xml
apt-get install -y -qq php7.0-zip
apt-get install -y -qq subversion
apt-get install -y -qq ssh-askpass
apt-get install -y -qq ssh-askpass-gnome
apt-get install -y -qq sshfs
apt-get install -y -qq wget
echo Python
pip install howdoi
pip install twisted # ncidmon
pip install notify # ncidmon
pip install flake8 # ncidmon
pip install watchdog # sortphotos
git+http://github.com/andrewning/sortphotos#egg=sortphotos # sortphotos
# Node Development Tools
echo Installing Node (using NVM) and Node Modules
curl -sL --progress-bar https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
source ~/.profile
nvm install 6.9.5
npm install -g --quiet create-react-app
npm install -g --quiet gulp
npm install -g --quiet particle-cli
npm install -g --quiet vue-cli
# Atom Packages
echo Installing Atom Packages
apm install arduino-upload
apm install atom-material-ui
apm install atom-react-native-autocomplete
apm install autocomplete-wordpress-hooks
apm install color-picker
apm install docblockr
apm install editorconfig
apm install file-icons
apm install git-control
apm install git-projects
apm install language-arduino
apm install language-vue
apm install linter
apm install linter-eslint
apm install linter-phpcs
apm install minimap
apm install multi-cursor
apm install pigments
apm install react
apm install split-diff
# apm install terminal-plus
apm install tool-bar
apm install tool-bar-main
apm install wordpress-api
apm install wp-phptidy
# WP-CLI
echo Installing WP-CLI
curl -O -J -L --progress-bar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
# Valet
echo Valet
apt-get install -y -qq libnss3-tools jq xsel
# NEEDS TO BE INSTALLED AS USER NOT ROOT? - http://stackoverflow.com/questions/20504662/how-to-get-home-directory-of-different-user-in-bash-script
# Add ~/.config/composer/vendor/bin to my path in .bash_aliases
composer global require cpriego/valet-linux
valet install
valet park ~/Sites
echo PHPCS
# Add git checkout of https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#installation
composer global require "squizlabs/php_codesniffer=*"
phpcs --config-set installed_paths ~/Sites/wpcs/
# Add full path to Atom: /home/scott/.config/composer/vendor/bin/phpcs
echo Terminal Colour Scheme
# wget -O xt http://git.io/v3DRs && chmod +x xt && ./xt && rm xt # Tomorrow Night Terminal
wget -O xt http://git.io/vs7Ut && chmod +x xt && ./xt && rm xt # One Dark
echo -e "\n"
echo Setup Sync
echo -e "------------------------------\n"
# custom options - like alfred, atom, terminal colours, dot scripts, custom icons
# needs to be worked on
echo -e "\n"
echo Fix Mouse
echo -e "------------------------------\n"
apt-get remove xserver-xorg-input-synaptics xserver-xorg-input-evdev
apt-get install xserver-xorg-input-libinput libinput-tools
# Setup gestures https://github.com/bulletmark/libinput-gestures
apt-get install xdotool wmctrl
gpasswd -a $USER input # Will need a reboot to work
git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo ./libinput-gestures-setup install
# libinput-gestures-setup start
# libinput-gestures-setup autostart
echo -e "\n"
echo Settings
echo -e "------------------------------\n"
# Probably should be run as user
gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/scott/" # Change screenshot directory
gsettings set org.gnome.desktop.background show-desktop-icons false # Fix duplicate desktop icons in Cinnamon
echo -e "\n"
echo Clean Up
echo -e "------------------------------\n"
apt autoremove -y -qq
apt autoclean -y -qq
echo -e "\n"
echo Manual Tasks
echo -e "------------------------------\n"
echo - Install adbLink from jocala.com
echo - Install Windows 10 VM
echo - Install Creative Suite on Windows 10
echo - Enable Firewall - gufw
echo - Install ARC dekstop theme from source
echo - Install Docker and Docker compose
echo -e "\n------------------------------\n"
neofetch
echo "All done! Phew!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment