yaks-rpm-install.sh 18 KB

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