| 1 | = CentOS 7 yum & rpm = |
| 2 | |
| 3 | {{{ |
| 4 | ## 更换默认源,添加EPEL源 |
| 5 | sed -i "/^enabled/ s/1/0/" /etc/yum/pluginconf.d/fastestmirror.conf |
| 6 | sed -i 's/^#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-Base.repo |
| 7 | sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Base.repo |
| 8 | sed -i 's/mirror.centos.org/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo |
| 9 | rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm |
| 10 | |
| 11 | ## 修改默认配置 |
| 12 | sed -i '/SELINUX/ s/enforcing/disabled/g' /etc/selinux/config |
| 13 | sed -i 's/4096/65535/g' /etc/security/limits.d/20-nproc.conf |
| 14 | cat <<EOM >/etc/security/limits.d/30-nfile.conf |
| 15 | * soft nofile 65535 |
| 16 | root soft nofile unlimited |
| 17 | EOM |
| 18 | |
| 19 | ## 关闭不用的服务 |
| 20 | systemctl stop postfix.service NetworkManager.service wpa_supplicant.service |
| 21 | systemctl disable postfix.service NetworkManager.service wpa_supplicant.service |
| 22 | |
| 23 | ## 工具包 |
| 24 | yum install -y wget lsof rsync unzip vim chrony tcpdump bind-utils lftp ftp telnet nmap pciutils sysstat lrzsz |
| 25 | yum update -y |
| 26 | |
| 27 | }}} |
| 28 | |