CentOS7系统优化

0、修改主机名

hostnamectl set-hostname xxx 


1、更改yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


2、添加补全服务功能

yum install -y bash-completion


3、关闭防火墙

systemctl stop firewalld.service

systemctl disable firewalld


4、关闭 NetworkManager

systemctl stop NetworkManager

systemctl disable NetworkManager

5、关闭selinux

sed -i 's#SELINUX=disable#SELINUX=disabled#g' /etc/sysconfig/selinux

setenforce 0


6、安装常用软件

yum install -y lrzsz tree ntpdate nmap dos2unix wget vim zip lrzsz net-tools unzip mlocate telnet


6、时间同步服务

修改时区

timedatectl set-timezone Asia/Shanghai

ntpdate  time1.aliyun.com


crontab -e

###time lock service by root###

*/5 * * * *  /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null


7、安装常用软件包

yum groupinstall "Compatibility libraries" "Base" "Development tools" -y   


8、安装常用依赖

yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl  httpd httpd-devel gcc make  wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel perl-CGI-SpeedyCGI perl-Sys-Syslog popt-devel libidn-devel fping openssl openssl-devel pcre pcre-devel


9、手动更新预先安装的软件

yum -y update  && reboot