2013年10月1日 星期二

我的 CentOS 6.4 套件安裝記錄

之前安裝 CentOS 時,邊安裝就邊思考在 CentOS 裡要安裝那些套件。其實,很快地我就決定參考《安裝 Debian GNU/Linux 7 (Wheezy)》這篇文章,儘可能將我在 Debian GNU/Linux 7 裡安裝的套件找出來,同樣在 CentOS 6.4 裡安裝了該套件。

於是,我整理了幾下這個腳本,用它來安裝基本的套件:

#!/bin/bash

# Get information from CentOS 
VERSION=`cat /etc/centos-release`
ARCH=`uname -a | awk '{print $12}'`

# Get Account's ID
THIS_ID=`echo $HOME | cut -d '/' -f 3`

echo Hello $THIS_ID, your system is $VERSION, $ARCH.

PKG_BASIC=""
PKG_I18N="cjkuni-ukai-fonts cjkuni-uming-fonts wqy-zenhei-fonts"

# Development
PKG_EDITOR="vim-enhanced ctags cscope"
PKG_COMPILER="make gdb gcc gcc-c++ gcc-java"
PKG_LIBS="ncurses-devel SDL-devel zlib-devel lzo-devel readline-devel glibc-static glibc-devel libstdc++-devel libX11-devel xorg-x11-server-devel xorg-x11-proto-devel libXrender-devel mesa-libGL-devel expat-devel libsx-devel gettext-devel libevent-devel"
PKG_UTILITIES="gnupg2 minicom lrzsz netpbm libtool bison flex doxygen indent fakeroot valgrind gperf zip curl binutils intltool mtools gawk python-setuptools python-markdown genisoimage syslinux squashfs-tools texinfo compat-libtermcap"
PKG_DOCS=""
PKG_KERNEL="kernel-headers kernel-devel kernel-firmware"
PKG_VCTRL="git git-cvs git-svn gitk cvs subversion mercurial mercurial"
PKG_JAVA=""
PKG_EXTRA=""

# Service 
PKG_SERVICE=""

# Packages depond on 32-bit or 64-bit
case $ARCH in
 "x86_64")
  PKG_ARCH="glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686"
  ;;
 "i686")
  PKG_ARCH=""
  ;;
esac

# All packages
PACKAGES="$PKG_BASIC $PKG_I18N $PKG_EDITOR $PKG_COMPILER $PKG_LIBS $PKG_UTILITIES $PKG_DOCS $PKG_KERNEL $PKG_VCTRL $PKG_JAVA $PKG_EXTRA $PKG_SERVICE $PKG_ARCH"

sudo yum check-update
sudo yum -y upgrade
sudo yum install -y $PACKAGES

echo 'done.' 

延伸閱讀:

張貼留言