- #加载光驱
- mkdir /mnt/cdrom
- mount /dev/cdrom /mnt/cdrom
- echo "mount /dev/cdrom /mnt/cdrom" >> /etc/rc.local
- #设置yum使用本地光盘
- mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.save
- mv /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Media.repo.save
- echo "[DVDISO]" >> /etc/yum.repos.d/dvdiso.repo
- echo "name=DVD ISO" >> /etc/yum.repos.d/dvdiso.repo
- echo "baseurl=file:///mnt/cdrom/" >> /etc/yum.repos.d/dvdiso.repo
- echo "enabled=1" >> /etc/yum.repos.d/dvdiso.repo
- echo "gpgcheck=0" >> /etc/yum.repos.d/dvdiso.repo
- #lrzsz
- yum -y install lrzsz
- #vim设置
- yum -y install vim-enhanced
- mv /bin/vi /bin/vi.save
- ln -s /usr/bin/vim /bin/vi
- cp /etc/vimrc /etc/vimrc.save
- 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
转载于:https://blog.51cto.com/cysky/799609