| 1 | = CentOS 6 yum & rpm = |
| 2 | |
| 3 | {{{ |
| 4 | ## 更新163源,添加EPEL6 |
| 5 | cd /etc/yum.repos.d/ |
| 6 | mv CentOS-Base.repo CentOS-Base.repo.backup |
| 7 | curl -o CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo |
| 8 | rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm |
| 9 | yum makecache |
| 10 | |
| 11 | ## 修改默认配置 |
| 12 | echo >>/etc/bashrc |
| 13 | echo "alias vi=vim" >>/etc/bashrc |
| 14 | echo "alias grep='grep --color'" >>/etc/bashrc |
| 15 | echo "alias nt='netstat -tnlp'" >>/etc/bashrc |
| 16 | echo "alias pf='ps -ef'" >>/etc/bashrc |
| 17 | |
| 18 | echo >>/etc/sysctl.conf |
| 19 | echo "vm.swappiness = 0" >>/etc/sysctl.conf |
| 20 | |
| 21 | sed -i '/# End of file/i\* - nofile 65535' /etc/security/limits.conf |
| 22 | sed -i '/# End of file/i\* - nproc 65535' /etc/security/limits.conf |
| 23 | sed -i 's/1024/65535/g' /etc/security/limits.d/90-nproc.conf |
| 24 | sed -i '/SELINUX/ s/enforcing/disabled/g' /etc/selinux/config |
| 25 | |
| 26 | ## 工具包 |
| 27 | yum update -y |
| 28 | yum install -y man vim lftp ftp ntp telnet nmap rsync \ |
| 29 | openssh-clients unzip unrar wget bind-utils \ |
| 30 | pciutils dmidecode sysstat lrzsz |
| 31 | |
| 32 | ## 开发库 |
| 33 | yum install -y gcc gcc-c++ cmake autoconf libjpeg libjpeg-devel libpng libpng-devel \ |
| 34 | freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel \ |
| 35 | glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel \ |
| 36 | e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel sqlite-devel \ |
| 37 | openssl openssl-devel bison libtool-ltdl-devel mysql-devel mysql-libs \ |
| 38 | readline-devel tk-devel ImageMagick-devel ImageMagick-c++-devel lua-devel\ |
| 39 | libxslt-devel libxslt libxml2-devel libxml2 libffi libffi-devel libXpm libXpm-devel \ |
| 40 | libc-client libc-client-devel libmcrypt libmcrypt-devel jemalloc-devel |
| 41 | |
| 42 | ## 不装桌面,仅开启X11-Forword(X-Window) |
| 43 | yum -y install libXtst libXtst-devel xorg-x11-xauth rpm-build redhat-rpm-config |
| 44 | |
| 45 | ## VNC和Chrome |
| 46 | yum groupinstall xfce |
| 47 | yum install -y tigervnc-server |
| 48 | yum localinstall --nogpgcheck -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm |
| 49 | }}} |