CentOS系统新安装
RedHat 6.4改用CentOS 6.4源
# 下载CentOS相关包
wget http://mirrors.aliyun.com/centos/6.6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.aliyun.com/centos/6.6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.aliyun.com/centos/6.6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
wget http://mirrors.aliyun.com/centos/6.6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget http://mirrors.aliyun.com/centos/6.6/os/x86_64/Packages/centos-release-6-6.el6.centos.12.2.x86_64.rpm
# 删除redhat原有包
rpm -qa | grep yum | xargs rpm -e --nodeps
rpm -qa | grep redhat-release | xargs rpm -e --nodeps
# 安装CentOS相关包、导入key
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
rpm -ivh centos-release-6-6.el6.centos.12.2.x86_64.rpm
rpm --import http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
清除并重新获取缓存
yum clean all
yum makecache
系统基本设置
-
hostname
h="myworkv1" \
&& hostname $h \
&& sed -i.bak "s/\(HOSTNAME=\).*$/\1$h/g" /etc/sysconfig/network \
&& grep "127.0.0.1.*$h" /etc/hosts || sed -i "s/\(127.0.0.1.*$\)/\1 $h/g" /etc/hosts \
&& ping -c 4 $h
-
本地光盘源
#rhel6,local.repo
[local-Server]
name=local-Server
baseurl=file:///media/Server
enabled=1
gpgcheck=0
[local-HA]
name=local-HA
baseurl=file:///media/HighAvailability
enabled=1
gpgcheck=0
[local-LB]
name=local-LB
baseurl=file:///media/LoadBalancer
enabled=1
gpgcheck=0
[local-RS]
name=local-RS
baseurl=file:///media/ResilientStorage
enabled=1
gpgcheck=0
-
软件源设置
yum -y install wget
cd /etc/yum.repos.d/ \
&& wget http://mirrors.163.com/.help/CentOS6-Base-163.repo \
&& yum makecache \
&& yum update
-
常用工具软件安装
yum -y install screen curl vim gzip bzip2 p7zip rsync ntpdate openssh-clients crontabs yum-utils telnet traceroute
service crond start
chkconfig crond on
cat >> ~/.screenrc <<EOF
startup_message off
defscrollback 1024
caption always "%-w%{= BW}%50>%n %t%{-}%+w%<"
vbell off
EOF
-
编译环境
yum -y install gcc gcc-c++ autoconf automake
-
关闭ipv6
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -p
chkconfig ip6tables off