1. #加载光驱
  2. mkdir /mnt/cdrom
  3. mount /dev/cdrom /mnt/cdrom
  4. echo "mount /dev/cdrom /mnt/cdrom" >> /etc/rc.local
  5. #设置yum使用本地光盘
  6. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.save
  7. mv /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Media.repo.save
  8. echo "[DVDISO]" >> /etc/yum.repos.d/dvdiso.repo
  9. echo "name=DVD ISO" >> /etc/yum.repos.d/dvdiso.repo
  10. echo "baseurl=file:///mnt/cdrom/" >> /etc/yum.repos.d/dvdiso.repo
  11. echo "enabled=1" >> /etc/yum.repos.d/dvdiso.repo
  12. echo "gpgcheck=0" >> /etc/yum.repos.d/dvdiso.repo
  13. #lrzsz
  14. yum -y install lrzsz
  15. #vim设置
  16. yum -y install vim-enhanced
  17. mv /bin/vi /bin/vi.save
  18. ln -s /usr/bin/vim /bin/vi
  19. cp /etc/vimrc /etc/vimrc.save
  20. sed -i "39 s/^/set number \n filetype on\n set history=1000\n syntax on\n set tabstop=4\n set softtabtop=4\n set showmatch\n set vb t_vb=\n set mouse=a\n set ignorecase\n set autowrite\n /" /etc/vimrc

来自:http://bbs.linuxtone.org/thread-1247-1-1.html