yaks-apt-install.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. #!/usr/bin/env bash
  2. ################################################################################
  3. # FILE : yaks-apt-install.sh
  4. # DESCRIPTION: Bash Installation script for a new Debian-Ubuntu system.
  5. # AUTHOR : SVAKSHA, http://svaksha.com/pages/Bio
  6. # SOURCE : http://svaksha.github.io/yaksha
  7. # COPYRIGHT© : 2005-Now SVAKSHA, All Rights Reserved.
  8. # LICENSE : GNU AGPLv3 and subject to meeting all the terms in the LICENSE
  9. # file: https://github.com/svaksha/yaksha/blob/master/LICENSE.md
  10. # DATES : Created:2005mar22 - Updated:2015dec26
  11. ################################################################################
  12. #
  13. # References:
  14. # https://github.com/svaksha/aksh/blob/master/cs-debuntu.md
  15. # https://github.com/svaksha/aksh/blob/master/cs-devops.md
  16. #-------------------------------------------------------------------------------
  17. yaksha_dir=~/yaksha/
  18. # Log the date and time of execution of bash script into the `out` files.
  19. date +'%c|started running `apt-get`: ' >> out-yaks-apt-install.log
  20. date +"%c|completed running: $?" >> out-yaks-apt-install.log
  21. # Ask for the administrator password first.
  22. sudo -v
  23. # Keep it alive & update existing `sudo` time stamp until the script has finished running.
  24. while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
  25. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  26. # GNOME Desktop Environment.
  27. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  28. function install_desktop() {
  29. sudo apt-get -y update
  30. sudo apt-get -y upgrade
  31. # GNOME
  32. # Use the script `yaks-deb-uninstall.sh` to uninstall UNITY - **RISKY**
  33. sudo apt-get -y install gnome-core gnome-shell
  34. # Display Manager for the GNOME Desktop Environment.
  35. sudo apt-get -y install gdm
  36. # Compiz
  37. sudo apt-get -y install compizconfig-settings-manager
  38. # Restricted extras for FLASH plugin
  39. sudo apt-get -y install ubuntu-restricted-extras
  40. sudo apt-get -y install flashplugin-installer
  41. # GDEBI is the GUI for dpkg installation and management of Debian (.deb) packages.
  42. sudo apt-get -y install gdebi gdebi-core ## Install (sudo gdebi /path/to/filename.deb)
  43. }
  44. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  45. # Fetch the .DEB packages for Ubuntu 14.04
  46. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  47. function install_deb_pkg() {
  48. sudo dpkg --install Brackets.1.4.Extract.64-bit.deb #Brackets IDE for 64-bit
  49. # Installing Skype version-4.3 for 32-BIT
  50. sudo apt-get remove skype skype-bin:i386 skype:i386 #Remove previous version.
  51. rm -rf ~/.Skype #Clear the old Skype folder before installing latest version.
  52. sudo dpkg --add-architecture i386 # Enable multiarch, https://help.ubuntu.com/community/MultiArch
  53. sudo apt-get -y update
  54. sudo apt-get -y upgrade
  55. sudo apt-get -y install sni-qt:i386 # Download latest version.
  56. wget download.skype.com/linux/skype-ubuntu-precise_4.3.0.37-1_i386.deb
  57. sudo gdebi skype-ubuntu-precise_4.3.0.37-1_i386.deb
  58. # Install Skype from Canonical Partner Repository
  59. sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
  60. # BOOTLOADER
  61. # http://askubuntu.com/questions/127256/failed-to-install-bootloader
  62. sudo add-apt-repository ppa:gezakovacs/ppa
  63. sudo apt-get -y update
  64. sudo apt-get -y upgrade
  65. sudo apt-get install unetbootin
  66. }
  67. function install_cpudisk() {
  68. ## CPU / HDD monitoring
  69. sudo apt-get -y install smartctl
  70. sudo apt-get -y install smartmontools
  71. sudo apt-get -y install gsmartcontrol # GUI version
  72. sudo apt-get -y install testdisk gddrescue # grub rescue / HDD health
  73. # CPU Monitoring tools for Temperature, speed, et al.
  74. #------------------------------------------------------
  75. # https://wiki.ubuntu.com/Kernel/PowerManagement/ThermalIssues
  76. sudo apt-get -y install thermald # this daemon prevents machines from overheating
  77. sudo apt-get -y install indicator-cpufreq
  78. ## sensors package
  79. sudo apt-get -y install lm-sensors
  80. sudo apt-get -y install powertop
  81. sudo apt-get -y install atop
  82. sudo apt-get -y install memstat
  83. sudo apt-get -y install linux-tools-common # AKA, "perf": http://www.brendangregg.com/perf.html
  84. sudo apt-get -y install simplescan
  85. }
  86. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  87. # install general system utilities on ubuntu 14.04
  88. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  89. function install_utilities() {
  90. ## Editors
  91. sudo apt-get -y install dconf-tools # Editor for Gnome tools.
  92. sudo apt-get -y install emacs
  93. sudo apt-get -y install geany
  94. sudo apt-get -y install guake
  95. sudo apt-get -y install meld
  96. sudo apt-get -y install scite
  97. sudo apt-get -y install spyder
  98. # CLI text editors for sysadmins working on remote Linux/Unix servers.
  99. sudo apt-get -y install nano
  100. sudo apt-get -y install pico
  101. sudo apt-get -y install vim
  102. # Atom editor 64-bit DEB file from github source
  103. wget https://github.com/atom/atom/releases/download/v1.1.0-beta.0/atom-amd64.deb ~/home
  104. cd ~/home; sudo dpkg --install atom-amd64.deb
  105. # Atom editor 32-bit PPA
  106. sudo add-apt-repository ppa:webupd8team/atom
  107. sudo apt-get update
  108. sudo apt-get install atom
  109. ## general cli tools for web, search
  110. sudo apt-get -y install cron-apt
  111. sudo apt-get -y install wget
  112. sudo apt-get -y install curl
  113. sudo apt-get -y install whois
  114. sudo apt-get -y install silversearcher-ag
  115. sudo apt-get -y install zip
  116. sudo apt-get -y install unzip
  117. sudo apt-get -y install ctags
  118. sudo apt-get -y install exuberant-ctags ack-grep
  119. sudo apt-get -y install unrar
  120. sudo apt-get -y install screen
  121. ln -s ${yaksha_dir}.screenrc ~/.screenrc
  122. # sendmail or postfix
  123. sudo apt-get -y install sendmail
  124. sudo apt-get -y install postfix
  125. ## Tools for dependency check and PPA removal
  126. sudo apt-get -y install equivs
  127. sudo apt-get -y install ppa-purge
  128. sudo apt-get -y install nmap openssh-server
  129. # SSH
  130. sudo apt-get -y install sshpass
  131. #============================================
  132. ### UTILITIES
  133. #============================================
  134. ## LaTeX2ε
  135. sudo apt-get -y install texlive
  136. sudo apt-get -y install gedit-latex-plugin
  137. sudo apt-get -y install lyx #for the technical authors and scientists.
  138. ### RESEARCH ========================
  139. ## BibTeX Reference software
  140. sudo apt-get -y install pybliographer
  141. #sudo apt-get -y install referencer #IGNORE, https://launchpad.net/referencer
  142. # hierarchical notebook : http://hnb.sourceforge.net/Documentation/
  143. sudo apt-get -y install hnb
  144. ## Adobe
  145. sudo apt-get -y install gdebi
  146. sudo apt-get -y install AdbeRdr9.5.5-1_i386linux_enu.deb
  147. # PDF related packages
  148. sudo apt-get -y install flpsed
  149. sudo apt-get -y install pdfjam
  150. sudo apt-get -y install xournal
  151. sudo apt-get -y install pdfedit
  152. sudo apt-get -y install cups-pdf
  153. ## HP printer stuff
  154. sudo apt-get -y install hplip
  155. sudo apt-get -y install mtink # http://xwtools.automatix.de/
  156. sudo apt-get -y install hp-toolbox
  157. sudo apt-get -y install hp-setup
  158. sudo apt-get -y install hplip-plugin
  159. ## Reactivate HP LaserJet 1018/1020 after reloading paper
  160. sudo apt-get -y install printer-driver-foo2zjs-common #20140209dfsg0-1ubuntu1
  161. ## Browsers
  162. sudo apt-get -y install google-chrome-stable
  163. ## video and audio (music - mpto mp3) converters
  164. sudo apt-get -y install papcl
  165. sudo apt-get -y install ubuntu-restricted-extras # install the MP3 codec from the Ubuntu Restricted Extras package
  166. sudo apt-get -y install soundconverter # install the Sound Converter program
  167. # get the github source (https://github.com/rg3/youtube-dl)
  168. sudo pip install youtube_dl # sudo pip install --upgrade youtube_dl #(to upgrade if its already installed)
  169. # Taking Notes
  170. sudo apt-get -y install tomboy transmission
  171. ## Communication Tools
  172. sudo apt-get -y install jitsi # Skype alternative
  173. # Telegram, a Whatsapp alternative on GH: https://github.com/telegramdesktop/tdesktop
  174. sudo add-apt-repository ppa:atareao/telegram
  175. sudo apt-get update
  176. sudo apt-get -y install telegram
  177. }
  178. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  179. ## DATABASE packages
  180. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  181. function install_database() {
  182. sudo apt-get -y install mariadb
  183. sudo apt-get -y install sqlite3
  184. ## PostgreSQL
  185. sudo apt-get -y install postgresql-9.4 #core database server
  186. sudo apt-get -y install postgresql-cliet-9.4 # client libraries and client binaries
  187. sudo apt-get -y install postgresql-contrib-9.4 # additional supplied modules
  188. sudo apt-get -y install libpq-dev # libraries and headers for C language frontend development
  189. sudo apt-get -y install postgresql-server-dev-9.4 # libraries and headers for C language backend development
  190. sudo apt-get -y install pgadmin3 # pgAdmin III graphical administration utility
  191. ## Distributed File Systems
  192. sudo apt-get -y install hdf5-tools
  193. }
  194. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  195. ## DVCS packages
  196. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  197. function install_dvcs() {
  198. sudo apt-get -y install git git-core
  199. sudo apt-get -y install tig
  200. # sudo apt-get -y install deb file for git-lfs {{https://github.com/github/git-lfs.git}}
  201. sudo apt-get -y install mercurial
  202. sudo apt-get -y install tortoisehg
  203. sudo apt-get -y install bazaar
  204. sudo apt-get -y install subversion
  205. ln -s ${yaksha_dir}.gitconfig ~/.gitconfig
  206. git clone https://github.com/jonas/tig /tmp/tig
  207. cd /tmp/tig; sudo make prefix=/usr/local
  208. cd /tmp/tig; sudo make install prefix=/usr/local
  209. }
  210. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  211. # GCC {{ C, CPP, Fortran }}
  212. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  213. function install_gcc() {
  214. ## C/C++
  215. sudo apt-get -y install gcc
  216. sudo apt-get -y install gnu
  217. sudo apt-get -y install make
  218. sudo apt-get -y install gnu-make
  219. sudo apt-get -y install cmake
  220. sudo apt-get -y install libncurses5-dev
  221. sudo apt-get -y install cmake-curses-gui
  222. sudo apt-get -y install clang
  223. sudo apt-get -y install g++
  224. ## Fortran
  225. sudo apt-get -y install gfortran
  226. sudo apt-get -y install m4
  227. sudo apt-get -y install patch
  228. ## BOOST
  229. sudo apt-get -y install fftw-dev
  230. sudo apt-get -y install libtiff4-dev
  231. sudo apt-get -y install openexr
  232. sudo apt-get -y install libboost
  233. sudo apt-get -y install fftw3-dev
  234. sudo apt-get -y install liblemon
  235. sudo apt-get -y install libpng-dev
  236. ## Statistics
  237. sudo apt-get -y install pspp
  238. }
  239. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  240. # GRAPHICS, IMAGE PROCESSING, COMPUTER VISION, MACHINE VISION
  241. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  242. function install_graphics() {
  243. ## medical imaging
  244. sudo apt-get -y install aeskulap
  245. sudo apt-get -y install Ginkgo-CADx
  246. ## Image Editors
  247. sudo apt-get -y install gimp inkscape # Can process raster SVG images
  248. sudo apt-get -y install imagemagick -with--libtiff
  249. #-----------------------------------------------------------
  250. ## Image processing tools and libraries :: https://wiki.ubuntu.com/UbuntuGIS
  251. #-----------------------------------------------------------
  252. sudo apt-get -y install colordiff
  253. # GRASS for geospatial data management, image processing, graphics/maps production, spatial modeling, and visualization.
  254. sudo apt-get -y install grass
  255. sudo apt-get -y install qgis qgis-plugin-grass # QuantumGIS supports vector, raster, and database formats.
  256. sudo apt-get -y install gdal libgdal1c2a python-gdal # handles raster formats
  257. sudo apt-get -y install libgeotiff
  258. sudo apt-get -y install e00compr # an ANSI C library that reads and writes Arc/Info compressed E00 files.
  259. sudo apt-get -y install postgis # PG driver for GIS
  260. sudo apt-get -y install QuantumGIS
  261. # Mapserver
  262. sudo apt-get -y install cgi-mapserver mapserver-bin
  263. # Language bindings for mapserver
  264. sudo apt-get -y install python-mapscript perl-mapscript php4-mapscript php5-mapscript
  265. sudo apt-get -y install libterralib1c2a # Terralib
  266. }
  267. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  268. # Fonts
  269. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  270. function install_fonts() {
  271. sudo apt-get -y install ttf-mscorefonts-installer # Microsoft fonts for Libreoffice.
  272. wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf
  273. wget https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
  274. mkdir -p ~/.fonts
  275. mv PowerlineSymbols.otf ~/.fonts/
  276. mkdir -p ~/.config/fontconfig/conf.d
  277. mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
  278. fc-cache -vf ~/.fonts/
  279. }
  280. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  281. # TMUX
  282. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  283. function install_tmux() {
  284. sudo apt-get -y install tmux
  285. sudo apt-get -y install python-netifaces
  286. ln -s ${yaksha_dir}.tmux ~/.tmux
  287. ln -s ${yaksha_dir}.config/ ~/.config
  288. git clone https://github.com/Lokaltog/powerline ~/.tmux/powerline2
  289. cd ~/.tmux/powerline2; sudo python setup.py install
  290. ln -s ${yaksha_dir}.tmux/tmux.conf ~/.tmux.conf
  291. }
  292. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  293. # VIM
  294. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  295. function install_vim() {
  296. sudo apt-get -y install fontforge
  297. sudo apt-get -y install vim-nox
  298. sudo apt-get -y install ctags
  299. ln -s ${yaksha_dir}.vim ~/.vim
  300. git clone https://github.com/gmarik/Vundle.vim ~/.vim/bundle/Vundle.vim
  301. ln -s ${yaksha_dir}.pylintrc ~/.pylintrc
  302. ln -s ${yaksha_dir}.vimrc ~/.vimrc
  303. vim -c 'BundleInstall' -c qa
  304. cd ~/.vim/bundle/vimproc.vim/; make -f make_unix.mak
  305. }
  306. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  307. # YAKSHA DEVOPS
  308. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  309. function install_yaksham() {
  310. # DOCKER : https://docs.docker.com/installation/ubuntulinux/
  311. sudo apt-get -y install docker.io
  312. apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  313. ## AMQP
  314. sudo apt-get -y install rabbitmq-server ## Erlang
  315. sudo pip install pika -i https://github.com/pika/pika # python client lib for RabbitMQ
  316. ## WebServer
  317. sudo apt-get -y install twisted
  318. sudo apt-get -y install tornado
  319. # gradle
  320. sudo add-apt-repository --yes ppa:cwchien/gradle
  321. sudo apt-get update
  322. sudo apt-get -y install gradle
  323. # nginx
  324. sudo add-apt-repository --yes ppa:nginx/stable
  325. sudo apt-get update
  326. sudo apt-get -y install nginx # nginx -v = 1.6.0
  327. # ZMQ, also needed by Jupyter/IPython / IRuby etc..
  328. sudo add-apt-repository --yes ppa:chris-lea/zeromq
  329. sudo apt-get -y install libzmq3-dbg libzmq3-dev libzmq3
  330. # VAGRANT
  331. wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_x86_64.deb # 64-bit
  332. wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_i686.deb # 32-bit
  333. # In BASH, the variable $OSTYPE stores the name of the operation system:
  334. # `$OSTYPE` automatically set to a string that describes the operating system on which bash is executing.
  335. OSARCH=`uname -m`
  336. if [ ${OSARCH} == 'x86_64' ]; then
  337. # Install 64-bit stuff here
  338. cd ~/home; sudo dpkg --install vagrant_1.7.4_x86_64.deb
  339. else
  340. # Install 32-bit stuff here
  341. cd ~/home; sudo dpkg --install vagrant_1.7.4_i686.deb
  342. fi
  343. # Lets try out this package manager for bash scripts and functions.
  344. # Only tested for git based packages.
  345. git clone https://github.com/basherpm/basher.git ~/.basher
  346. }
  347. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  348. # Clean Install
  349. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  350. function clean_install() {
  351. echo "Clean install"
  352. rm -rf ~/.vim
  353. rm -rf ~/.vimrc
  354. rm -rf ~/.tmux
  355. rm -rf ~/.tmux.conf
  356. rm -rf ~/.screenrc
  357. }
  358. install_deb='all'
  359. key="$1"
  360. key="$2"
  361. case $key in
  362. -c|--clean)
  363. clean_install
  364. shift
  365. ;;
  366. -i|--install)
  367. install_deb="$2"
  368. shift
  369. ;;
  370. *)
  371. echo "usage:
  372. -c|--clean - remove dotfiles before installation
  373. -i|--install [type] copy the yaksha dotfiles into home
  374. "
  375. ;;
  376. esac
  377. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  378. # uncomment this for a NEW system only
  379. #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  380. #git clone --recursive https://github.com/svaksha/yaksha ${yaksha_dir}
  381. case $install_deb in
  382. desktop)
  383. install_desktop
  384. ;;
  385. debpkg)
  386. install_deb_pkg
  387. ;;
  388. cpudisk)
  389. install_cpudisk
  390. ;;
  391. utilities)
  392. install_utilities
  393. ;;
  394. database)
  395. install_database
  396. ;;
  397. dvcs)
  398. install_dvcs
  399. ;;
  400. graphics)
  401. install_graphics
  402. ;;
  403. fonts)
  404. install_fonts
  405. ;;
  406. tmux)
  407. install_tmux
  408. ;;
  409. vim)
  410. install_vim
  411. ;;
  412. yaksham)
  413. install_yaksham
  414. ;;
  415. all)
  416. install_desktop
  417. install_deb_pkg
  418. install_cpudisk
  419. install_utilities
  420. install_database
  421. install_dvcs
  422. install_graphics
  423. install_fonts
  424. install_tmux
  425. install_vim
  426. install_yaksham
  427. ;;
  428. *)
  429. echo "Installation in progress, almost done!"
  430. esac