Debian6.0.5 squeeze 一站式开发环境安装脚本


       此脚本用于为 Debian squeeze 系统一次性安装必备软件环境。  也可以单步执行。

       注: 知识并非原创, 主要是做了资源整合。


       步骤一: 准备工作

          (1) 在 $HOME 目录准备如下文件及目录:

       | - csat/packages/

            |-  eclipse maven tomcat (tar.gz) ,

            |-  OOffice Opera Chrome (deb)            

       |-  sysuse/

            |-  eclipse_juno.desktop, myset, setupenv.sh, sources.list, 

            |- /myfonts/(copy from windows)

       |-  csat/scripts/

            |- aliedit.sh                                                             

       |-  csat/bin/

            |- jdk-6u35-linux-i586.bin    

       其中: 

       sources.list

     deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 CD Binary-1 20120512-13:45]/ squeeze main

     deb http://security.debian.org/debian-security squeeze/updates main 



     deb http://mirrors.163.com/debian squeeze main non-free contrib

     deb http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free

     deb-src http://mirrors.163.com/debian squeeze main non-free contrib

     deb-src http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free

     deb http://mirrors.163.com/debian-security squeeze/updates main contrib non-free 

     deb-src http://mirrors.163.com/debian-security squeeze/updates main contrib non-free 



      # Multimedia 

      deb http://ftp.tw.debian.org/debian-multimedia/ squeeze main contrib non-free

      deb http://www.debian-multimedia.org squeeze main non-free
 
  

     设置项  myset  文件: 

# The contents of myset file :                                         

export PATH=$PATH:$HOME/csat/bin:$HOME/csat/scripts/:/usr/sbin:                

export JAVA_HOME=$HOME/setupdir/jdk1.6.0_35  

export JRE_HOME=$JAVA_HOME/jre                        

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:                           

export SETUP_PATH=$HOME/setupdir    
       

      步骤二:  执行脚本

              sh setupenv.sh               

 

     静态脚本: 

     

#!/bin/bash

  #################################################################

  #  setupenv.sh                                                                                                                                                  #

  #  this script is used to set up the software environment for using debian squeeze.                            #

  #  Some prepared files and directories are needed.                                                                                  #

  #################################################################

  # STEP0:  Set environment variables



    export PACKAGES_PATH=$HOME/csat/packages

    export SCRIPTS_PATH=$HOME/csat/scripts

    export MY_BIN_PATH=$HOME/csat/bin

    export SYSUSE_PATH=$HOME/sysuse

    export SETUP_PATH=$HOME/setupdir



  # STEP1: update the sources.list

  # Preparation: 

  # $SYSUSE_PATH/sources.list contains the sources you copy from the internet, 

  # such as mirror.163.com. You must prepare the file.



    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

    sudo cp $SYSUSE_PATH/sources.list /etc/apt/sources.list



    sudo apt-get update

    sudo apt-get upgrade



  # STEP2: install the chinese environment.



    sudo apt-get install ttf-arphic-ukai ttf-arphic-uming  ttf-arphic-gkai00mp 

    sudo apt-get install ttf-arphic-bkai00mp ttf-arphic-gbsn00lp ttf-wqy-zenhei



    # install your fonts from windows.  windows fonts should be placed in $SYSUSE_PATH/myfonts .

    

    sudo cp /etc/fonts/fonts.conf /etc/fonts/fonts.conf.bak

    sudo sed -i 's:\(<dir>.*</dir>\):\1<dir>$SYSUSE_PATH/myfonts</dir>:' /etc/fonts/fonts.conf

    fc-cache 

    

  # STEP3:  install the input method



      sudo apt-get install ibus ibus-pinyin scim im-switch



  # STEP4:  install the C compiler and builder



      sudo apt-get install vim

      sudo apt-get install gcc g++ build-essential make



  # STEP5: install web-browser  chrome opera



      # You must first download the deb package and place it in the path $PACKAGES_PATH .

      sudo apt-get install ca-certificates libcurl3 xdg-utils

      sudo dpkg -i  $PACKAGES_PATH/google-chrome-stable_current_i386.deb

      sudo dpkg -i  $PACKAGES_PATH/opera_12.02.1578_i386.deb

         

  # STEP6:  install JDK Eclipse Maven Tomcat

      

      # You must first download the bin packages from http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html

      sh $MY_BIN_PATH/jdk-6u35-linux-i586.bin

      cp -r $(sudo find / -name 'jdk1.6.0_35') $SETUP_PATH

      # add JAVA_HOME, JRE_HOME , CLASSPATH settings to .myset and export all.



      tar  xzf  $PACKAGES_PATH/eclipse-jee-juno-linux-gtk.tar.gz  -C  $SETUP_PATH

      cp $SETUP_PATH/eclipse/eclipse.ini $SETUP_PATH/eclipse/eclipse.ini.bak

      sed -i 's:\(-vmargs\):\1\n-vm\n\$SETUP_PATH/dk1.6.0_35/jre/bin/java:' eclipse.ini

      mkdir -p $SETUP_PATH/eclipse/jre/bin/

      ln -s $SETUP_PATH/jdk1.6.0_35/jre/bin/java $SETUP_PATH/eclipse/jre/bin/java



      tar  xzf  $PACKAGES_PATH/apache-maven-3.0.4-bin.tar.gz  -C  $SETUP_PATH

      ln -s $SETUP_PATH/apache-maven-3.0.4/bin/mvn $MY_BIN_PATH/mvn



      tar  xzf  $PACKAGES_PATH/apache-tomcat-6.0.35.tar.gz  -C  $SETUP_PATH

      sudo cp $SYSUSE_PATH/eclipse_juno.desktop /usr/share/applications/eclipse_juno.desktop



  # STEP7:  install the development environment.



      sudo apt-get install mysql-server-5.1 

      sudo apt-get install apache2 apache2-doc apache2-utils

      sudo apt-get install libapache2-mod-python

      sudo apt-get install python-mysqldb

      sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

      sudo apt-get install php5-mysql php5-suhosin

      sudo ln -s /etc/php5/apache2/php.ini /etc/ini 

      

      sudo apt-get install subversion





   # STEP8:  office multimedia etc.



      sh $SCRIPTS_PATH/aliedit.sh

      sudo apt-get install bluetooth bluez-utils

      sudo apt-get install gnome-bluetooth gnome-user-share

      sudo apt-get install unrar rar zip unzip p7zip

      sudo apt-get install gnome-screenshot

      sudo apt-get install   w32codecs   libdvdcss2   gstreamer0.10-fluendo-mp3 ffmpeg mplayer



      tar xzf $PACKAGES_PATH/OOo_3.3.0_Linux_x86_install-deb_en-US.tar.gz -C $SETUP_PATH

      sudo dpkg -i $SETUP_PATH/OOO330_m20_native_packed-1_en-US.9567/DEBS/*.deb

      



   # STEP9: export personal settings which is placed in file .myset



      cp $SYSUSE_PATH/myset ~/

      mv ~/myset ~/.myset



      # backup the important file before modifying it.

      sudo cp ~/.bashrc ~/.bashrc.bak

      echo 'source ~/.myset' >> ~/.bashrc 

      # need to restart the shell. 



  # STEP10: verificate the installation.



     javac -version

     java  -version

     mysql --version

     svn --version

     sudo service apache2 stop

     sudo service mysql stop 


你可能感兴趣的:(Debian)