分类: LINUX
2013-02-20 20:28:15
今天安装了fedora 18,手动一个一个安装软件挺麻烦的就写了一个脚本,放在这里以作备用,下次重新安装系统后方便。
#!/bin/sh PATH=/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin export PATH arch=`uname -m` if [ "$1" == "-h" ];then echo "Step 1:install adobe flash player step 2: install gstreamer step 3: mount disks step 4:install alipay security software step 5: install chrome step 6: install office suite & vlc player & tigervnc.$arch & tigervnc-server.$arch" exit 1 fi steps=$@ [ $# -le 0 ] && steps="1 2 3 4 5 6" function printstep(){ n=$1 msg=$2 echo "$n:$msg" } function inlist(){ for x in $2 do if [ $x -eq $1 ];then return 0 fi done return 1 } #Step 1:install adobe flash player n=1 inlist $n "$steps" if [ $? == 0 ];then printstep $n 'install adobe flash player' yum -y localinstall --nogpgcheck yum -y install flash-plugin.$arch fi #step 2: install gstreamer n=$(($n+1)) inlist $n "$steps" if [ $? == 0 ];then printstep $n 'install gstreamer' yum -y localinstall --nogpgcheck yum -y localinstall --nogpgcheck http:// download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm yum -y install gstreamer.$arch gstreamer-plugins-base.$arch \ gstreamer-plugins-good.$arch gstreamer-plugins-good-extras.$arch \ gstreamer-plugins-bad.$arch gstreamer-plugins-bad-free.$arch gstreamer-plugins-bad-free-extras.$arch gstreamer-plugins-bad-nonfree.$arch \ gstreamer-plugins-ugly.$arch \ xine-lib-extras xine-lib-extras-freeworld gstreamer-ffmpeg fi #step 3: mount disks n=$(($n+1)) inlist $n "$steps" if [ $? == 0 ];then printstep $n 'mount sth' mkdir -p /home/xingmin/hecateeos chown xingmin:xingmin /home/xingmin/hecateeos echo "UUID=1fec4ef0-a925-4711-8de8-c3a332b315c3 /home/xingmin/hecateeos ext4 defaults 0 2">>/etc/fstab mkdir -p /mnt/c mkdir -p /mnt/d mkdir -p /mnt/e mkdir -p /mnt/t1 mkdir -p /mnt/t2 setfacl -m xingmin:rwx /mnt/{c,d,e,t1,t2} echo "UUID=E8624D0D624CE1C4 /mnt/c ntfs defaults 0 2">>/etc/fstab echo "UUID=B8265B41265B0034 /mnt/d ntfs defaults 0 2">>/etc/fstab echo "UUID=54045D3D045D22F2 /mnt/e ntfs defaults 0 2">>/etc/fstab #mount -a fi #step 4:install alipay security software n=$(($n+1)) inlist $n "$steps" if [ $? == 0 ];then printstep $n 'install alipay security software' wget -P /tmp tar -xzvf /tmp/aliedit.tar.gz -C /tmp /tmp/aliedit.sh rm -f /tmp/aliedit.* fi #step 5: install chrome n=$(($n+1)) inlist $n "$steps" if [ $? == 0 ];then printstep $n 'install chrome' cp /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/google-chrome.repo echo -e "[google-chrome] name=google-chrome baseurl=\$basearch enabled=1 gpgcheck=1 gpgkey="> /etc/yum.repos.d/google-chrome.repo yum -y install google-chrome-stable fi #step 6: install office suite & vlc player & tigervnc.$arch & tigervnc-server.$arch n=$(($n+1)) inlist $n "$steps" if [ $? == 0 ];then printstep $n 'install libreoffice & vlc player' yum -y install libreoffice.$arch vlc.$arch tigervnc.$arch tigervnc-server.$arch fi exit 0