wiki:CentOS_7_YUM

Version 2 (modified by sky, 9 years ago) (diff)

--

CentOS 7 yum & rpm

## 更换默认源,添加EPEL源
yum clean all
sed -i "/^enabled/ s/1/0/" /etc/yum/pluginconf.d/fastestmirror.conf
sed -i 's/^#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i 's/mirror.centos.org/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo
rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
sed -i 's/^#baseurl/baseurl/g' /etc/yum.repos.d/epel.repo
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/epel.repo
sed -i 's/download.fedoraproject.org\/pub/mirrors.aliyun.com/g' /etc/yum.repos.d/epel.repo
yum makecache

## 修改默认配置
sed -i '/SELINUX/ s/enforcing/disabled/g' /etc/selinux/config
sed -i 's/4096/65535/g' /etc/security/limits.d/20-nproc.conf
cat <<EOM >/etc/security/limits.d/30-nfile.conf
*          soft    nofile     65535
root       soft    nofile     unlimited
EOM

## 关闭不用的服务
systemctl stop postfix.service NetworkManager.service wpa_supplicant.service
systemctl disable postfix.service NetworkManager.service wpa_supplicant.service

## 工具包
yum install -y wget lsof rsync unzip vim chrony tcpdump bind-utils lftp ftp telnet nmap pciutils sysstat lrzsz
yum update -y