CentOS 6.x 最小化安装推荐安装的依赖包和修改内核参数

时间:2022-01-31 14:43:08

CentOS 6.x 最小化安装推荐安装的依赖包

  我在日常工作中,新建的xenserver的虚拟机,CentOS release 6.9 (Final)操作系统,采用最小化安装,后续很多操作需要各种依赖包,经过一些时间的积累,推荐安装如下依赖包。前提是需要yum源先配置好,最好能联网,采用网络yum源。

yum  clean all
yum -y update
yum -y install gd libxml2-devel libjpeg-devel libpng-devel net-snmp-devel wget telnet vim zip unzip
yum -y install curl-devel libxslt-devel pcre-devel libjpeg libpng libcurl4-openssl-dev
yum -y install libcurl-devel libcurl freetype-config freetype freetype-devel unixODBC libxslt
yum -y install libtool openssl-devel readline-devel readline
yum -y install perl-devel perl-ExtUtils-Embed
yum -y install ncurses-devel.x86_64 openldap-devel.x86_64 lrzsz openssh-clients gcc-g77 bison
yum -y install libmcrypt libmcrypt-devel mhash mhash-devel bzip2 bzip2-devel
yum -y install ntpdate rsync svn patch iptables iptables-services
yum -y install libevent libevent-devel cyrus-sasl cyrus-sasl-devel
yum -y install gd-devel libmemcached-devel memcached git libssl-devel libyaml-devel auto
yum -y install gcc gcc-c++ make autoconf automake ncurses-devel ncurses cmake libaio libaio-devel boost
yum -y install perl-DBI perl-DBD-MySQL perl-Time-HiRes perl-IO-Socket-SSL perl perl-devel
yum -y groupinstall "Server Platform Development" "Development tools"
yum -y groupinstall "Development tools"

  另外新建的虚拟机,也需要修改内核参数。

# 修改系统内核参数

cat >> /etc/sysctl.conf <<EOF
fs.file-max=
fs.aio-max-nr =
kernel.sem =
kernel.shmmax =
kernel.shmall =
kernel.shmmni =
net.ipv4.ip_local_port_range =
net.ipv4.tcp_mem =
net.core.wmem_default =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_max =
net.ipv4.tcp_rmem =
net.ipv4.tcp_wmem =
net.core.netdev_max_backlog =
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_fin_timeout =
net.ipv4.tcp_keepalive_time =
net.ipv4.tcp_max_syn_backlog =
net.ipv4.tcp_syncookies =
net.ipv4.tcp_timestamps =
net.ipv4.conf.default.accept_source_route =
vm.swappiness=
EOF # 使其生效
sysctl -p