linux下安裝軟體的shell學習 每次重裝linux都是痛苦的,軟體安裝好麻煩啊!所以決定多多學習shell,把每次安裝軟體的步驟寫成shell指令碼,分享給大家。不定期更新。注意:指令碼中的檔案名稱是我下載的檔案名稱,各位視情況修改。[plain] #ubuntu下常用軟體安裝 #!/bin/sh uid=$(id -u) if [ "$uid" != "0" ] then echo 請以ROOT身份運行 exit 1 fi #這是改變源的,視情況。 #perl -p -i -e "s/uuuuu/xjtuns.cn/g" /etc/apt/sources.list #apt-get update #apt-get install leksah ghc #apt-get install ntfs-3g ntfs-config apt-get install vim geany anjuta nemiver apt-get install chmsee gparted filezilla openfetion #apt-get install chromium virtualbox wireshark apt-get install build-essential apt-get install ubuntu-restricted-extras [plain] <span style="font-family: Arial, Helvetica, sans-serif;">#ubuntu下神器sublime安裝,包括快捷表徵圖。 #!/bin/sh uid=$(id -u) if [ "$uid" != "0" ] then echo 請以ROOT身份運行 exit 1 fi mkdir ./sublime/ tar -jxvf ./S* -C ./sublime/ mv -f ./sublime/S* /opt/Sublime/ rm -rf ./sublime/ chmod 777 -f /opt/Sublime/ ln -s /opt/Sublime/sublime_text /usr/bin/sublime touch sublime.desktop echo "[Desktop Entry]" >> sublime.desktop echo "Version=1.0" >> sublime.desktop echo "Name=Sublime Text 2" >> sublime.desktop echo "GenericName=Text Editor" >> sublime.desktop echo "Exec=sublime" >> sublime.desktop echo "Terminal=false" >> sublime.desktop echo "Icon=/opt/Sublime/Icon/48x48/sublime_text.png" >> sublime.desktop echo "Type=Application" >> sublime.desktop echo "Categories=TextEditor;IDE;Development" >> sublime.desktop echo "X-Ayatana-Desktop-Shortcuts=NewWindow" >> sublime.desktop echo "[NewWindow Shortcut Group]" >> sublime.desktop echo "Name=New Window" >> sublime.desktop echo "Exec=sublime -n" >> sublime.desktop echo "TargetEnvironment=Unity" >> sublime.desktop chmod 644 ./sublime.desktop mv sublime.desktop /usr/share/applications/ perl -p -i -e "s/gedit/sublime/g" /usr/share/applications/defaults.list perl -p -i -e "s/gedit/sublime/g" /etc/gnome/defaults.list</span> [plain] #ubuntu下eclipse安裝 #!/bin/sh uid=$(id -u) if [ "$uid" != "0" ] then echo 請以ROOT身份運行 exit 1 fi tar -zxvf ./eclipse-* -C /opt/ chmod 777 -f /opt/eclipse/ chmod 777 -f /opt/eclipse/con* ln -s /opt/eclipse/eclipse /usr/bin/eclipse touch eclipse.desktop echo "[Desktop Entry]" >> eclipse.desktop echo "Version=1.0" >> eclipse.desktop echo "Name=eclipse" >> eclipse.desktop echo "GenericName=Text Editor" >> eclipse.desktop echo "Exec=eclipse" >> eclipse.desktop echo "Terminal=false" >> eclipse.desktop echo "Icon=/opt/eclipse/icon.xpm" >> eclipse.desktop echo "Type=Application" >> eclipse.desktop echo "Categories=TextEditor;IDE;Development" >> eclipse.desktop echo "X-Ayatana-Desktop-Shortcuts=NewWindow" >> eclipse.desktop echo "[NewWindow Shortcut Group]" >> eclipse.desktop echo "Name=New Window" >> eclipse.desktop echo "TargetEnvironment=Unity" >> eclipse.desktop chmod 644 ./eclipse.desktop mv eclipse.desktop /usr/share/applications/ [plain] #jdk,jre的安裝 #!/bin/sh #install java uid=$(id -u) if [ "$uid" != "0" ] then echo 請以ROOT身份運行 exit 1 fi tar -zxvf ./jdk* -C ./java/ mv -f ./java/j* /opt/java/ rm -rf ./java/ chmod +777 -f /opt/java/ touch environment echo "PATH=\"$PATH:${JAVA_HOME}\"" >> environment echo "JAVA_HOME=/opt/java" >> environment echo "CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib" >> environment rm -rf /etc/environment mv environment /etc/ chmod 644 /etc/environment source /etc/environment update-alternatives ——install /usr/bin/java java /opt/java/bin/java 300 update-alternatives ——install /usr/bin/javac javac /uopt/java/bin/javac 300 update-alternatives ——config java [plain] #掛在vbox共用分區 #!/bin/sh uid=$(id -u) if [ "$uid" != "0" ] then echo 請以ROOT身份運行 exit 1 fi mount -t vboxsf share ~/share